File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes exhausted ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "exhausted ResultSet" Watch "exhausted ResultSet" New topic
Author

exhausted ResultSet

shobhita srinivasan
Greenhorn

Joined: Mar 18, 2010
Posts: 7
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

Joined: Mar 18, 2010
Posts: 7
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

Joined: Dec 20, 2006
Posts: 2495
    
    8

Hi Shobhita ,
Can you share the solution? It can help other ranchers that have the same issue.
Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
shobhita srinivasan
Greenhorn

Joined: Mar 18, 2010
Posts: 7
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

Joined: Dec 20, 2006
Posts: 2495
    
    8

Thank you for posting the solution.

Jan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: exhausted ResultSet