GetCursor Call Fails With JDBC OCI Driver When Returning Data From a RefCursor (Doc ID 373427.1)

Last updated on OCTOBER 05, 2010

Applies to:

JDBC - Version: 10.1.0.2 to 10.2.0.2 - Release: 10.1 to 10.2
Information in this document applies to any platform.

Symptoms

Calls to the JDBC method getCursor to return a result set from a stored procedure fails with a
java.sql.SQLException when using any version of the 10.x.x.x JDBC OCI driver.

The problem does not reproduce when using the 9.2.x.x OCI driver.
The problem does not reproduce when using any version of the JDBC Thin driver.

The top lines of exception stacks resulting from such a call resemble the following:

Exception in thread "main" java.sql.SQLException: 7
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:676)
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:602)
at oracle.jdbc.driver.T2CConnection.RefCursorBytesToStatement(T2CConnection.java:709)
at oracle.jdbc.driver.ResultSetAccessor.getCursor(ResultSetAccessor.java:60)
at oracle.jdbc.driver.OracleCallableStatement.getCursor(OracleCallableStatement.java:1653)

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