*
The moose likes JDBC 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
Bookmark "java.sql.SQLException: Exhausted Resultset" Watch "java.sql.SQLException: Exhausted Resultset" New topic
Author

java.sql.SQLException: Exhausted Resultset

Jinal Jhaveri
Greenhorn

Joined: Aug 12, 2004
Posts: 4
Hi,

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
Greenhorn

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
Consultant @ Xebia. Sonny Gill Tweets
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Jinal,

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
Greenhorn

Joined: Nov 24, 2004
Posts: 3
Hi,
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
recursively.
So try to close result sets as soon as possible.


Monu G
Jinal Jhaveri
Greenhorn

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 : resultset.next() 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...
-----------------------------------------------
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.sql.SQLException: Exhausted Resultset