File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Calling Remote DB Stored Procedure which returns Ref Cursor" Watch "Calling Remote DB Stored Procedure which returns Ref Cursor" New topic

Calling Remote DB Stored Procedure which returns Ref Cursor

BabuRajendraPrasad Tavva

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(
at oracle.jdbc.driver.T4CTTIoer.processError(
at oracle.jdbc.driver.T4CTTIoer.processError(
at oracle.jdbc.driver.T4C8Oall.receive(
at oracle.jdbc.driver.T4CStatement.doOall8(
at oracle.jdbc.driver.T4CStatement.fetch(
at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(

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,
I agree. Here's the link:
subject: Calling Remote DB Stored Procedure which returns Ref Cursor
It's not a secret anymore!