File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes retruring recordset to beginning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "retruring recordset to beginning" Watch "retruring recordset to beginning" New topic
Author

retruring recordset to beginning

dale conn
Ranch Hand

Joined: Jun 16, 2006
Posts: 57
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

Joined: Apr 25, 2006
Posts: 47
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

Joined: Jun 16, 2006
Posts: 57
thanks

stmt = conn.createStatement(rs.TYPE_SCROLL_INSENSITIVE, rs.CONCUR_READ_ONLY);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retruring recordset to beginning
 
Similar Threads
HTML -> Servlet -> java bean -> JSP
Reading Socket!!
resultset and .first() query
Counting number of records in result set
Indian Edition - Java/J2EE Job Interview Companion