This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
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 Customer Requirements for Developers 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: 32328

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]
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
It's not a secret anymore!