Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stored Procedures

 
Rajeev Iyer
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !!
If my stored procedure rerurns more than one reslut,how do I receive it in my JSP?
Thanks in advance...
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really a JDBC question, rather than one about JSP, so I've moved it to the JDBC forum for you.
 
Jagdeep Singh
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Loop arround the result set and get it row by row.
 
Seema
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic