Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting stored procedure resultset from JDBC

449819Aug 10 2005 — edited Aug 11 2005
I'm trying to call a stored procedure from Java.

I setup my CallableStatement and execute.

CallableStatement cs = dbConnection.prepareCall("{call GET_USER(?,?)}");
cs.registerOutParameter(2,OracleTypes.CURSOR);
cs.setString(1, user.getUsername());
cs.execute();
dbResultSet = ((OracleCallableStatement)cs).getCursor(1);

It just hangs on execute forever. I have tested against other Stored Procedures that are not supposed to return a ResultSet and those work fine from same Database.

The stored procedure signature looks like this.

PROCEDURE GET_USER(userLogon varchar2,curData OUT sys_refcursor)

I have tested the stored procedure in SQL*Plus and it is working correctly. How can I get these results back into my Java application correctly?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 8 2005
Added on Aug 10 2005
12 comments
918 views