Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to return cusror from PL/SQL script?  RSS feed

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to return cursor from pl/sql procedures to java and other front end tools?

Thanks in advance,
Yamini
 
Shailesh Chandra
Ranch Hand
Posts: 1084
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try on google.

There are number of results.

Shailesh
[ April 07, 2005: Message edited by: Shailesh Chandra ]
 
Kash Mhai
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Declare the out parameter for the procedure as recordset
Eg.// o_out_data OUT PKG_NAME.recordset
2. use -
OPEN o_out_data
FOR
//SELECT STATEMENT GOES HERE
3. End of the package.

This should be accessed through Java as
cstmt.registerOutParameter(1,OracleTypes.CURSOR);
and to cast it into ResultSet
rs = (ResultSet)cstmt.getObject(1);

This should work.

Have fun..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!