aspose file tools*
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

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
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
It is sorta covered in the JavaRanch Style Guide.
subject: Iterating resultset