This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

obtaining one result set at a time from multiple select

john mattucci
Ranch Hand
Posts: 331
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling a stored procedure which returns multiple result sets. My problem which I cant seem to figure out; when I call cs.getResultSet() all result sets are returned ie 4. Im using ThinWeb Technologies(tm) Driver Version 1.3 for MS SQL Server. Why is this happening???
CallableStatement cs = myCon.prepareCall("{call initial_info (?)}");
cs.setInt(1, InfoGetter.locationInt);

boolean success = cs.execute();
int i = 0;
myRs = cs.getResultSet();
information[i] = new Vector();
if(i == 0 || i == 1)
information[i].addElement(new Integer(myRs.getInt(1)));
else if(i == 2)
else if(i == 3)
Object o[] = new Object[2];
o[0] = myRs.getString(1);
o[1] = new Integer(myRs.getInt(2));
success = cs.getMoreResults();
//close connections
CREATE PROC initial_info(@location int)
SELECT route From route WHERE location = @location
AND type = 0 ORDER BY [route] ASC;
SELECT number From bdrdsmnum WHERE location = @location
ORDER BY [number] ASC;
SELECT name From salereps WHERE location = @location
ORDER BY [name] ASC;
SELECT description, number From marketsegments;
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic