Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exhausted ResultSet

 
shobhita srinivasan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i am trying to fetch the data present in my database in my servlet but i am getting the follwing error:

error code= 17011
SQLState= null
java.sql.SQLException: Exhausted Resultset

i am using the .next() method but i still seem to be getting this exception. what all could be the possible reasons for it???
 
shobhita srinivasan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi again
i cannot believe that i made such a stupid ,mistajke and i cannot believe this fact either that i was able to detect it... problem solved..!!!
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shobhita ,
Can you share the solution? It can help other ranchers that have the same issue.
Regards, Jan
 
shobhita srinivasan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

the problem i was mainly facing was that i was using a resultset and passing the values of my database in it. i was also using the .next() method but the mistake i was making was that i was terminating the while loop before it even starts iterating.

ie: i was writing while(rs.next());
instead of while(rs.next())

the power of the semicolon..!!!
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for posting the solution.

Jan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic