GeeCON Prague 2014*
The moose likes JDBC and the fly likes Stored Procedures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Stored Procedures" Watch "Stored Procedures" New topic
Author

Stored Procedures

Rajeev Iyer
Ranch Hand

Joined: Jun 19, 2002
Posts: 42
Hi !!
If my stored procedure rerurns more than one reslut,how do I receive it in my JSP?
Thanks in advance...
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
This is really a JDBC question, rather than one about JSP, so I've moved it to the JDBC forum for you.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Jagdeep Singh
Ranch Hand

Joined: Oct 14, 2002
Posts: 106
Loop arround the result set and get it row by row.


Jagdeep Singh<br />SCJP;SCWCD;IBM Certified XML Solution Developer;SCBCD1.3
Seema
Greenhorn

Joined: Aug 05, 2002
Posts: 15
Hi Rajeev,
Depending upon the no. of resultsets ur defined procedure is returning , set no. of OUT parameters in Stored procedures and return ref cursors thr. these OUT parameters fields and use in JSP .
Sample code is given below:
CallableStatement callStmt = dbConnection.prepareCall("{CALL sampleProcedure(?,?,?,?)}");

callStmt.setInt(1,123);
callStmt.setString(2, "xyz");
callStmt.registerOutParameter(3, OracleTypes.CURSOR);
callStmt.registerOutParameter(4, OracleTypes.CURSOR);

callStmt.executeQuery();
ResultSet rstSet = (ResultSet) callStmt.getObject(3);
ResultSet rstSet1 = (ResultSet) callStmt.getObject(4);

I hope this may help u.
//Seema
Originally posted by Rajeev Iyer:
Hi !!
If my stored procedure rerurns more than one reslut,how do I receive it in my JSP?
Thanks in advance...
 
 
subject: Stored Procedures