File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "Iterating resultset" Watch "Iterating resultset" New topic

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é

Joined: Nov 24, 2005
Posts: 14688

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
I agree. Here's the link:
subject: Iterating resultset
jQuery in Action, 3rd edition