• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting 2 different resultset from same CallableStatement

 
Padmanathan Veerasamy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Forgive me for posting thisIf my question was discussed already. If so give me the link.

By executing the stored procedure once using callableStatemet.exeecute() can we get 2 different result set associated with different cursor. Is there any variable in java.sql.Types supporting cursor.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, this is possible. Call CallableStatement.getResultSet() to get the first result set. Then call CallableStatement.getMoreResults() to move to the next result set. Then call CallableStatement.getResultSet() again to get a reference to the second ResultSet.

Note that the first result set is closed when you advance to the second.
[ July 27, 2006: Message edited by: Scott Johnson ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Padmanathan AV",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Arvind Sampath
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always invoke the callableStatementObj.getObject(int) and cast it to a ResultSet object.



Hope this helps.


Arvind
 
Padmanathan Veerasamy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arvind Sampath / Scott Johnson, Thank you very much.

Bear Bibeault, I have updated my name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic