File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
author & internet detective

Joined: May 26, 2003
Posts: 33132

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Resultset Exhausted Exception
jQuery in Action, 3rd edition