my dog learned polymorphism
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 Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Multiple Result Sets" Watch "Multiple Result Sets" New topic

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.
I agree. Here's the link:
subject: Multiple Result Sets
It's not a secret anymore!