JDBC driver 11.1.0.6 Causes NullPointerException To Be Thrown From oracle.jdbc.driver.DatabaseError.throwSqlException (Doc ID 1488031.1)

Last updated on MAY 19, 2017

Applies to:

JDBC - Version 11.1.0.6 to 11.1.0.6 [Release 11.1]
Information in this document applies to any platform.

Symptoms

In Oracle JDBC 11.1.0.6, IOException containing a null message causes a NullPointerException to be thrown from  oracle.jdbc.driver.DatabaseError.throwSqlException instead of passing the underlying database exception using a SQLException.

The exception stack is:

java.lang.NullPointerException
...
Caused by: java.lang.NullPointerException
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:335)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:938)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1122)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:973)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1244)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3469)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3514)


Since JDBC is not counting on the IOException having a null message, it fails with the following error message:

DBConnection.createStatement Failure on connection 19
ERROR Code: 17008, SQL State: 99999
java.sql.SQLException: Closed Connection
  at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
  at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:403)
  at oracle.jdbc.driver.PhysicalConnection.createStatement(PhysicalConnection.java:2925)

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms