File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Multiple Result Sets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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
 
Similar Threads
Result Set
Retriving data from table
How to check if resultset has only one row or more?
Memory leak with MySQL JDBC driver
How ResultSet works? PreparedStatment handicaps?