jQuery in Action, 3rd edition
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
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: 32501

It looks like you are never getting a match to set the boolean to false and end the loop. When hResultSetQL.next() gets called after it has run out of data, you get the error.
It is good to use a while(hResultSetQL.next()) 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
Have you checked out Aspose?
subject: Resultset Exhausted Exception
It's not a secret anymore!