JDBC/JTds getMoreResults trouble

S

stef

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 ?
 
Joined
Oct 30, 2007
Messages
2
Reaction score
0
have you tried changing your variables around? maybe try rset = new ResultSet maybe try rewriting: this.rs = ResultSet.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top