aspose file tools*
The moose likes JDBC and the fly likes Exahausted ResultSet Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exahausted ResultSet Error" Watch "Exahausted ResultSet Error" New topic
Author

Exahausted ResultSet Error

rambabu desina
Ranch Hand

Joined: May 26, 2012
Posts: 35

Dear Ranchers,

i have got the following error



and my java code is


it is not multithreaded program.
please tell me reasons for Exahuasted resulset.


thanks and regards
Ram.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

rambabu desina wrote:please tell me reasons for Exahuasted resulset.


There's only one reason. The cursor was at the end of the ResultSet, and you called the next() method, asking to move the cursor to the non-existent next row.

In your example there, that would mean that the ResultSet was empty.
rambabu desina
Ranch Hand

Joined: May 26, 2012
Posts: 35

Paul Clapham wrote:
rambabu desina wrote:please tell me reasons for Exahuasted resulset.


There's only one reason. The cursor was at the end of the ResultSet, and you called the next() method, asking to move the cursor to the non-existent next row.

In your example there, that would mean that the ResultSet was empty.


thanks for reply.
i executed query at toad it is giving results.
but when i executed using above programe it was giving exhausted resultset error .

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

Sorry. Trying to persuade yourself that the error message is lying to you is a very poor debugging strategy. I suggest you try a better strategy, namely to assume that the error message is correct and start working from there. Denial is just not a practical approach.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

If your query relies on implicit conversion, the problem might be that your Java session locale differ from TOAD session locale, making identical query return different results. This typically happens with dates. See Avoid Implicit Conversions.

I'm just guessing, of course, as you didn't provide enough information. I may well be wrong.
 
wood burning stoves
 
subject: Exahausted ResultSet Error