This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes getting 2 different resultset from same CallableStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "getting 2 different resultset from same CallableStatement" Watch "getting 2 different resultset from same CallableStatement" New topic
Author

getting 2 different resultset from same CallableStatement

Padmanathan Veerasamy
Greenhorn

Joined: Jul 27, 2006
Posts: 2
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

Joined: Aug 24, 2005
Posts: 518
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

Joined: Jan 10, 2002
Posts: 56554
    
  14

"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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Arvind Sampath
Ranch Hand

Joined: May 11, 2005
Posts: 144
You can always invoke the callableStatementObj.getObject(int) and cast it to a ResultSet object.



Hope this helps.


Arvind
Padmanathan Veerasamy
Greenhorn

Joined: Jul 27, 2006
Posts: 2
Arvind Sampath / Scott Johnson, Thank you very much.

Bear Bibeault, I have updated my name.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting 2 different resultset from same CallableStatement
 
Similar Threads
WA #1.....word association
How to change cursor height based on Font size
Mouse Pointer Change
hot spot optimization techniques?
Two Submit buttons in JSP Page