JDBC Driver 12.1.0.1 Returns Zero From GetObject(1, Long.class) When Value Is Null (Doc ID 1640052.1)

Last updated on MARCH 08, 2017

Applies to:

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

Symptoms

Version 12.1.0.1 of the Oracle JDBC driver adds support for the following getObject methods:

T getObject(int parameterIndex,
  java.lang.Class type)
  throws SQLException


and

T getObject(java.lang.String parameterName,
  java.lang.Class type)
  throws SQLException


For example:


However, when using these new implementations, a NULL value is incorrectly returned as a 0 (zero) for the java.lang.Long and java.lang.Integer classes.

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