This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Multiple Result Sets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Multiple Result Sets" Watch "Multiple Result Sets" New topic
Author

Multiple Result Sets

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
I have an app that is returning 5 result sets. When I run this stored procedure outside of my java app, it seems to work okay. However when I execute query it is doing something strange. The first result set will always only return one row. However the others could have multiple rows. The first time I did a cs.executeQuery().... worked fine. To read the next result set I did


For some reason it is reading the result set as if it has 2 rows.... when it actually only has one row when I run it outside of the java app. Any ideas? I'm sure it's something stupid I've done, but I just can't seem to put my finger on it.
Thanks for any help you can give me!
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
The callable statement will return the array. Just iterate it and collect the result sets.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Multiple Result Sets