View Single Post
  #5 (permalink)  
Old 06-18-2008, 11:20 AM
masijade masijade is offline
Senior Member
 
Join Date: Jun 2008
Posts: 150
masijade is on a distinguished road
Quote:
Originally Posted by sandeeprao.techno View Post
You cannot use the resultset more than once...
Once you have called the next row(), the resultset cannot be called back to the previous row...
Yes you can, create a Scrollable ResultSet (see the API docs for the createStatement() method), scroll through it with next(), then call either beforeFirst() and scroll through it with next() again. The only question is why?

If the ResultSet is not too large, why don't you just save the rows to an ArrayList as you go through it the first time, then use that ArrayList for any further actions? That would completely eliminate any network latency on additional reads.
Reply With Quote