aspose file tools*
The moose likes JDBC and the fly likes Resultset Exhausted Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Resultset Exhausted Exception" Watch "Resultset Exhausted Exception" New topic

Resultset Exhausted Exception

Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
Hi All,
I am getting following exception :-
java.sql.SQLException: Exhausted Resultset
while retrieving values from resultset. I am trying to retrieve values for multiple users but getting this exception only for one user and for others it is working fine.

Can anyone help me???
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 29219

It looks like you are never getting a match to set the boolean to false and end the loop. When gets called after it has run out of data, you get the error.
It is good to use a while( loop. That removes any possibility of running out of result set. Also, note that resultsets are never null after returning from the database. They can be empty, but not null.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Resultset Exhausted Exception
Similar Threads
default values due to Exhausted Resultset- classcast exception
Exhausted Resultset exception when result count is huge.
exhausted ResultSet
Query about rollback() method
Exhausted Resultset