| 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
|
|
"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.
|
 |
 |
|
|
subject: getting 2 different resultset from same CallableStatement
|
|
|