Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exahausted ResultSet Error

 
rambabu desina
Ranch Hand
Posts: 42
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21291
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21291
32
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic