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: to - Release: 10.1 to 10.2
Information in this document applies to any platform.


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(
at oracle.jdbc.driver.T2CConnection.checkError(
at oracle.jdbc.driver.T2CConnection.checkError(
at oracle.jdbc.driver.T2CConnection.RefCursorBytesToStatement(
at oracle.jdbc.driver.ResultSetAccessor.getCursor(
at oracle.jdbc.driver.OracleCallableStatement.getCursor(


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