wood burning stoves*
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 Android Security Essentials Live Lessons this week in the Android forum!
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: 14687
    
  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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Iterating resultset
 
Similar Threads
How to write to new table?
Resultset.next() taking more time
Behaviour of ResultSet
Resulset performance problem.
Java Mail