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.