• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exhausted Resultset  RSS feed

 
jacob lask
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have received exhausted result set and this is my first time encountering this problem. I am unable to find help anywhere online to solve as it is said to be solve based on the codes of the programmer.

This is part of my code and it helps me check where I've gone wrong in order to solve this issue. I will put a comment in the line where the error exist in.

Please mind any syntax error here if any found as I have removed some lines which are redundant.

 
Tim Cooke
Marshal
Posts: 4051
239
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, and welcome to the Ranch!

The while loop on lines 4 to 11 are iterating through the entire result set. But then later on line 23 you attempt to get more stuff from the result set after you've already been through it all. That's why you get the exhausted result set exception.
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

what does the retrieveTheData() method do?
Is it returning a fresh ResultSet or the same one?

Either way there's question marks over this code, as you don't seem to ever close the ResultSet.
And reusing a ResultSet variable like that is prone to errors.

You might find it easier to follow your code (I know I would) if you broke it down into smaller methods.
At the moment you seem to be getting and processing all in one big blob.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!