users
[Top] [All Lists]

RE: [cinjug-users] ResultSet closing prematurely

To: "'Jason Kretzer/STAR BASE Consulting Inc.'" <JKretzer@xxxxxxxxxxxxxxx>, users@xxxxxxxxxx
Subject: RE: [cinjug-users] ResultSet closing prematurely
From: "Turner, Keith" <keith.turner@xxxxxxx>
Date: Thu, 20 May 2004 13:28:39 -0700
Delivered-to: mailing list users@cinjug.org
Mailing-list: contact users-help@cinjug.org; run by ezmlm
The problem may be in the SQL Statement itself.  Try running the SQL statement in SQLPlus (or whatever you us) to make sure the problem is not in the statement.
-----Original Message-----
From: Jason Kretzer/STAR BASE Consulting Inc. [mailto:JKretzer@xxxxxxxxxxxxxxx]
Sent: Thursday, May 20, 2004 4:18 PM
To: users@xxxxxxxxxx
Subject: [cinjug-users] ResultSet closing prematurely


I have a query that returns two records and using a standard while loop, I get the records.  For some reason the loop is only entered once and then I get the exception at the bottom on the second iteration.  The exception references the while(rs.next())

Anyone know what could cause this?




ResultSet rs = stmt.executeQuery("some_query");

while(rs.next())
{
        //do something with rs
}




com.ibm.db2.jcc.b.SQLException: Invalid operation: result set closed
<Prev in Thread] Current Thread [Next in Thread>
  • RE: [cinjug-users] ResultSet closing prematurely, Turner, Keith <=