My Oracle Support Banner

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

Last updated on FEBRUARY 03, 2019

Applies to:

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


In Oracle JDBC, 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:

Caused by: java.lang.NullPointerException
at oracle.jdbc.driver.DatabaseError.throwSqlException(
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(

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(
  at oracle.jdbc.driver.DatabaseError.newSQLException(
  at oracle.jdbc.driver.DatabaseError.throwSqlException(
  at oracle.jdbc.driver.DatabaseError.throwSqlException(
  at oracle.jdbc.driver.DatabaseError.throwSqlException(
  at oracle.jdbc.driver.PhysicalConnection.createStatement(



To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.