Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLException: ResultSet Exhuasted

 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

thanks
Trupti
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic