GeeCON Prague 2014*
The moose likes JDBC and the fly likes Iterating resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Iterating resultset" Watch "Iterating resultset" New topic
Author

Iterating resultset

Prasath Premkumar
Ranch Hand

Joined: Nov 13, 2008
Posts: 43

Hi all,

I have a confusion about iterating resultset.



If the above code segment checks for empty resultsets too, then whats the advantage of using,




Can anyone please explain this and what is the best way to do the iterating part?

Thanks in advance.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Calling first() allow you to move the cursor back to the ResultSet. This could be useful if you are using the same ResultSet somewhere else, and you want to reiterate from the start. If you don't, then you don't need to use first().


[My Blog]
All roads lead to JavaRanch
 
GeeCON Prague 2014
 
subject: Iterating resultset