wood burning stoves 2.0*
The moose likes JDBC and the fly likes SQLException: ResultSet Exhuasted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQLException: ResultSet Exhuasted" Watch "SQLException: ResultSet Exhuasted" New topic

SQLException: ResultSet Exhuasted

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
I have below code that is working fine in prod.

I moved the project from Starteam/ant to maven/mercurial.
Now when I am trying to test the new maven package and try to test above piece of code, I get the error
SQLException"ResultSet exhuasted.

The code has not been changed. Nothing has been changed on DB side.
I use ojdbc.jar

Does not make sense that abbove code works fine with old way of packaging and returns error when moved to maven pacakging.

Can some one give any pointes?
I googled for the error and I see that generally when the resultset is closed and one tries to access it , you get the error.
Also When you don't do resultset.next you get above error.

Any pointers please.

Jan Cumps

Joined: Dec 20, 2006
Posts: 2491

Can you give us the exact error output, and if possible the code line where it is happening ?

Were you using ojdbc.jar too in the past?

What do the super.close....() methods do?

Regards, Jan

OCUP UML fundamental and ITIL foundation
youtube channel
trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
When I try to run the code in debug mode All I see that when I hit the line

The control goes to finally block. looks like reportResult.next() is false.
and when I click on the below line inside (add watch) window I see SQL Exception:resultset exusted.

But actually the code is not throwing the SQLException cause my code runs fine but does not return any records from DB even though valid data is ther. If I run same query from toad it returns data.

super.close has below code inside it.

Jan Cumps

Joined: Dec 20, 2006
Posts: 2491

Do I understand correctly that :
  • It does not throw "SQLException: ResultSet Exhausted"?
  • And that SELECT * from trades WHERE market_id= ? AND order= ? returns no record?
  • And TOAD does return a record for the same query?

  • Then check if you are connecting to the same database / schema, with the same user account.
    Can you print the value of dealQuery for us, and can you show us your TOAD query?
    I agree. Here's the link: http://aspose.com/file-tools
    subject: SQLException: ResultSet Exhuasted
    Similar Threads
    Uploading and Retrieving images using Java/JDBC
    Testing Database Connection
    store and retreive the image from oracle
    Closing Connection Which way ????
    JDBC Exception Handling