aspose file tools*
The moose likes JDBC and the fly likes Error: java.sql.SQLException: After end of result set Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error: java.sql.SQLException: After end of result set" Watch "Error: java.sql.SQLException: After end of result set" New topic
Author

Error: java.sql.SQLException: After end of result set

Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

I never came across such error... When i executing my JSP page that uses AJAX to generate report from the values in the DB..this error message is displayed in console....But there is no problem with the page..it works fine... May be a warning??? .... What kinda error this is.. I guess it reaches the End of ResultSet.. and so it throws an error.....Am i right? If not then please explain me what is THIS???


Never try to be a hard-worker. Be a smart-worker.
My Blog
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

If you call rs.next() and it returns false, then the status of the ResultSet is 'after last', that is it has read the last piece of data and move to a point beyond this.

If you try to read data from a ResultSet at this point, you get the exception you saw.

It is an error in the code, not a warning from the database.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

You should really focus on the code that throws the exception. Right now it looks like you are lumping a whole lot of different things into one big confusing ball of string.

You have a JSP which generates a page. That page contains some Javascript which generates an AJAX request. And when the request is processed, there's an exception. (Is that right?)

So, the JSP which generates the page is irrelevant for now. The Javascript is irrelevant for now. All you have to look at is the code which threw the exception and find out why it did that. (My guess is that you have a query which returned zero records and you assumed it would return one or more, but that's just a guess. Look at the code yourself.) Once you know that, then you can start fixing whatever caused the problem.
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Originally posted by Paul Clapham:
You should really focus on the code that throws the exception. Right now it looks like you are lumping a whole lot of different things into one big confusing ball of string.

You have a JSP which generates a page. That page contains some Javascript which generates an AJAX request. And when the request is processed, there's an exception. (Is that right?)

So, the JSP which generates the page is irrelevant for now. The Javascript is irrelevant for now. All you have to look at is the code which threw the exception and find out why it did that. (My guess is that you have a query which returned zero records and you assumed it would return one or more, but that's just a guess. Look at the code yourself.) Once you know that, then you can start fixing whatever caused the problem.


Its awesome??? its right Paul.... I wonder how you find this... Ok..thats why you are a bartender i think... I have a query which returns zero and what should i do to fix the error.....Please let me know how to fix it..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error: java.sql.SQLException: After end of result set