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 java.sql.SQLException: Exhausted Resultset 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 "java.sql.SQLException: Exhausted Resultset" Watch "java.sql.SQLException: Exhausted Resultset" New topic

java.sql.SQLException: Exhausted Resultset

Jinal Jhaveri

Joined: Aug 12, 2004
Posts: 4

When I try to stress test my servlet with lots of request (clicks), I get the java.sql.SQLException: Exhausted Resultset exception. Anyways to solve this problem?
Howard Watson
Ranch Hand

Joined: Jan 07, 2004
Posts: 56
Hi Jinal,

I tried a search on Exhausted Resultset exception and got some hits. Did any of these apply to you?
Jinal Jhaveri

Joined: Aug 12, 2004
Posts: 4
No not yet
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Post some code, mate, and if there is a logical error in it, somebody may be able to spot it.

The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082


How may records are resultset is containing.
what is record count ???

Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
monu garg

Joined: Nov 24, 2004
Posts: 3
Jinal , i was getting same error few days back.
What you maybe doing here is opening too much resultsets without closing them.Sometimes its not immediately visible, since u maybe doing it somewhere
So try to close result sets as soon as possible.

Monu G
Jinal Jhaveri

Joined: Aug 12, 2004
Posts: 4
Thanks everybody. I just found my own post and thought would post the solution. The problem was because my application was not multithreaded. I had some global variables. After making them local, everything worked fine!
Pankaj Patel
Ranch Hand

Joined: Jul 13, 2006
Posts: 73
Use : next() method of Resultset.
Reason : Returns Advances the record cursor by one record. Returns a boolean value indicating success or failure. Failure occurs if the cursor moved ...

I was solving the same problem and resolved it through this.

Pankaj Patel.
SCJP 1.5
Enjoy the world of Programming...
I agree. Here's the link:
subject: java.sql.SQLException: Exhausted Resultset
It's not a secret anymore!