Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retruring recordset to beginning

 
dale conn
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i have this code

rs = stmt.executeQuery(sql);

while (rs.next())
{
.....
}

after processing the while loop, how do i return the rs back to the beginning?

thanks for any help
 
aslam parveez
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using jdbc2.0 then your result set can be scrollable result set.
And if you create a scrollable result set then you can move around the resultset pointer wherever needed like calling rs.first() will take the resultset pointer to the first record.
 
dale conn
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks

stmt = conn.createStatement(rs.TYPE_SCROLL_INSENSITIVE, rs.CONCUR_READ_ONLY);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic