My Oracle Support Banner

Internal Error: Overflow Exception trying to bind NaN And java.lang.NullPointerException When Using NaN in JDBC 11.2 (Doc ID 1477336.1)

Last updated on AUGUST 30, 2023

Applies to:

JDBC - Version 11.2.0.3.0 and later
Information in this document applies to any platform.

Symptoms

When invoking java.sql.PreparedStatement#addBatch() method using Oracle JDBC driver 11.2.0.3 and having one of its parameters set to Nan using PreparedStatement.setObject(i, (Object) Double.NaN, java.sql.Types.DOUBLE), the setObject() method throws SQLException:

Internal Error: Overflow Exception trying to bind NaN [java.sql.BatchUpdateException]

This then leaves the connection in a strange state, such that subsequent use causes the NullPointerException.

Here is an example code with which the same errors can be reproduced:

 
And this is the error produced:

java.sql.SQLException: Internal Error: Overflow Exception trying to bind NaN
at oracle.jdbc.driver.DoubleBinder.bind(OraclePreparedStatement.java:17068)
at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:3137)
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2355)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3571)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
at testcase.TestOracleNan.makeTest(TestOracleNan.java:40)
at testcase.TestOracleNan.main(TestOracleNan.java:14)
java.lang.NullPointerException
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1885)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3571)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
at testcase.TestOracleNan.makeTest(TestOracleNan.java:50)
at testcase.TestOracleNan.main(TestOracleNan.java:14)

Changes

 

Cause

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
Symptoms
Changes
Cause
Solution
References


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