my dog learned polymorphism*
The moose likes JDBC and the fly likes Calling Remote DB Stored Procedure which returns Ref Cursor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Calling Remote DB Stored Procedure which returns Ref Cursor" Watch "Calling Remote DB Stored Procedure which returns Ref Cursor" New topic
Author

Calling Remote DB Stored Procedure which returns Ref Cursor

BabuRajendraPrasad Tavva
Greenhorn

Joined: Jun 30, 2009
Posts: 6
Hi Friends,
Good Afternoon.
I have a problem related to accessing a remoted database stored procedure which returns cursor. I am accessing stored procedures from my local DB which returns ref cursor. There is no problem with local DB procedures and I am able to read the data from cursor.
But In case of remote DB, I am not able to read the data. I am able to make a call to remote DB stored procedure. The return value is also valid and able to type cast to ResultSet type. I checked the ResultSetMetaData also on type casted ResultSet object. The column names from ResultSetMetaData object are correct.

The major problem is when I try to read the data from ResultSet. I am getting the Exception, "java.sql.SQLException: ORA-24338: statement handle not executed".

The stack trace of that Exception is as follows.

java.sql.SQLException: ORA-24338: statement handle not executed
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.fetch(T4CStatement.java:1029)
at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:291)
at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:213)

Please note that the same stored procedure is created in local DB also. When I execute this, I am able to read the Data from ResultSet.

When I go through the concept of ref cursors in PL/SQL documentation, I read some where that the memory reference is given/returned in case of ref cursor.
Is my current problem is because of remote DB or something else? I could not locate the actual issue.

Please somebody look into this and give some suggessions. Awaiting for your valuable suggessions.

Thanks in advance.

Best Regards,
Rajendra
 
jQuery in Action, 2nd edition
 
subject: Calling Remote DB Stored Procedure which returns Ref Cursor
 
Similar Threads
Mapping java collections as In parameters to Varrays
DBUnit ...looading data to database getting error of integrity constraint
Error while executing query through JDBC
JDBC Connection
How to handle java.sql.SQLException: ORA-01410: invalid ROWID