Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes while (rs.next()) not stopping at EOF. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "while (rs.next()) not stopping at EOF." Watch "while (rs.next()) not stopping at EOF." New topic
Author

while (rs.next()) not stopping at EOF.

Brian K Swingle
Ranch Hand

Joined: Jun 20, 2003
Posts: 39
Hello all,
I am using a MySql database. and am using a while(rs.next()) statement to loop through the result set. i watch tomcats activity through a command prompt window. I have a System.out.println(""+RecordNumber+""); set up so i can see what record number the Resultset is on. my table has 1962 records and after the Resultset loops unitl it hits record number 1962 it errors with java.lang.NullPointerException . I'm guessing that it means the ResultSet is trying to move to the next record but there isn't one. Can anyone give me any ideas as to why this might be happening. The servlet just started doing this. Any help is greatly appreciated.
Thanks,
brian
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8914
    
    8

How's about sharing the exact code that is giving you a problem?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
GeeCON Prague 2014
 
subject: while (rs.next()) not stopping at EOF.