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 SQLException: ResultSet Exhuasted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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 you get above error.

Any pointers please.

Jan Cumps

Joined: Dec 20, 2006
Posts: 2532

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 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: 2532

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:
    subject: SQLException: ResultSet Exhuasted