aspose file tools
The moose likes JDBC and the fly likes ResultSet Exhausted Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "ResultSet Exhausted" Watch "ResultSet Exhausted" New topic
Author

ResultSet Exhausted

Ayan Biswas
Ranch Hand

Joined: Jul 10, 2010
Posts: 95

What is wrong with the above code?Please help!!!


AyanBiswas
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56229
    
  13

Are you serious? Are you getting an error? What is it you want us to look for?

Also, please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.

And, please be sure to take the time to compose descriptive subjects for your posts. You will attract people who will can give you better and faster answers when your posts have good, descriptive subjects. For more information, please click this link ⇒ UseAMeaningfulSubjectLine. You can change your subject line by clicking the button on your post.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26216
    
  66

One thing that's wrong is the following:



There needs to be in between.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ayan Biswas
Ranch Hand

Joined: Jul 10, 2010
Posts: 95
It is still not working.it is throwing the following exception:
Exception in thread "main" java.sql.SQLException: Exhausted Resultset
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

1) have you read the API for the ResultSet next() method?
2) what do you think the error means?

The ResultsSet class behaviour for cursors and the use of the 'next' method is important but not too difficult a concept. It is however something you'll need to look up and understand.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26216
    
  66

There also needs to be an if statement in between.

Rather than saying you are still getting the error, it would be helpful to show the updated code.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: ResultSet Exhausted
 
Similar Threads
exception question from kb
Exception
How to create scrolling text?
doubt in throws Exception
Dan's mock question