Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JDBC/JTds getMoreResults trouble

Reply
Thread Tools

JDBC/JTds getMoreResults trouble

 
 
stef
Guest
Posts: n/a
 
      10-30-2007
Hello,
with JDBC 3.0 and jtds 1.2.2 I try to retrieve multiple recordset with
....
r = stmt.execute(Query);

// how many resultsets did we really find ?
nbrs=0;
rs= new ResultSet[30]; // hard limit

while (r)
{
rs[nbrs]=stmt.getResultSet();

nbrs++;

// trouble
r = stmt.getMoreResults(Statement.KEEP_CURRENT_RESULT) ;
}

If I execute, for example, a stored procedure which returns 2
resultsets, the stmt.getMoreResults() throws:

java.lang.IllegalStateException: There should be no queued results ???

Now, if I change to r = stmt.getMoreResults(); it works... (but of
course I lose my previous resultset)

What's wrong in my code ?

 
Reply With Quote
 
 
 
 
mdtsdca mdtsdca is offline
Junior Member
Join Date: Oct 2007
Posts: 2
 
      10-30-2007
have you tried changing your variables around? maybe try rset = new ResultSet maybe try rewriting: this.rs = ResultSet.
 

Last edited by mdtsdca; 10-30-2007 at 08:34 PM..
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
i have no trouble to send , ihave trouble reciving mail --any ideas John Penney Computer Support 4 08-29-2006 08:45 PM
having trouble securing my wireless laptop FireBrick Wireless Networking 2 08-10-2004 12:37 PM
Trouble staying connected to wifi Michael Giroux Wireless Networking 1 08-03-2004 08:33 PM
Trouble connecting in public hot spots Andres Perez Wireless Networking 2 07-16-2004 06:47 PM
trouble with caching or caching the trouble Hypo ASP .Net 6 08-01-2003 07:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57