Home » Open Source » Programming Interfaces » Latest JDBC driver throws strange error while querying LONG
Latest JDBC driver throws strange error while querying LONG [message #265202] Wed, 05 September 2007 14:06 Go to next message
dandormont
Messages: 12
Registered: April 2006
Junior Member
I am running a Java application that talks to an Oracle 9i database and fetches data from an ordinary SELECT statement on a table containing a LONG column. Upgrading to the latest Oracle JDBC driver ( 9.2.0.8 ) introduced this strange error:
java.sql.SQLException: Io exception: execution completed with warning
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
	at oracle.jdbc.ttc7.LongTTCItem.getChars(LongTTCItem.java:200)
	at oracle.jdbc.dbaccess.DBDataSetImpl.getCharsStreamItem(DBDataSetImpl.java:1656)
	at oracle.jdbc.driver.OracleStatement.getCharsInternal(OracleStatement.java:3630)
	at oracle.jdbc.driver.OracleStatement.getStringValue(OracleStatement.java:3841)
	at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:460)

This error did not occur with the 9.2.0.5 driver. Note I am using the THIN driver rather than OCI. I would attach a complete test case but unfortunately I have not been able to reproduce the issue on a simple test table. The code is roughly as follows:
while (rs.next()) {
   for (int i=1; i <= numFields; i++) {
      String s = rs.getString(i);
      doSomethingWith(s);
   }
}

The LONG column is the 13th out of 19 total columns: the others are all NUMBER or VARCHAR2. As you can see I am fetching the columns in the order they appear in the ResultSet. I have also disabled AutoCommit.
Re: Latest JDBC driver throws strange error while querying LONG [message #265212 is a reply to message #265202] Wed, 05 September 2007 14:59 Go to previous message
dandormont
Messages: 12
Registered: April 2006
Junior Member
In response to the obvious answer of "switch back to 9.2.0.5" unfortunately I can't do that because of a (possibly?) unrelated bug in which while performing an INSERT using a PreparedStatement with a large number of placeholders (more than around 50 or so) we would get an error "ORA-01461: can bind a LONG value only for insert into a LONG column" when we were inserting data into a table of VARCHAR2(2000) columns and all of the strings were well under that limit.
Previous Topic: Calling Data from Excel
Next Topic: I don't have database
Goto Forum:
  


Current Time: Thu Nov 21 10:47:28 CST 2024