Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes Scrolable ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Scrolable ResultSet" Watch "Scrolable ResultSet" New topic
Author

Scrolable ResultSet

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I have a question about the java.sql.ResultSet interface. What is a TYPE_SCROLL_SENSITIVE ResultsSet? Can it scroll forward, backward, bidirectional?
Usambara Veilchen
Greenhorn

Joined: Dec 07, 2000
Posts: 5
In a default ResulSet you can only go forward, but you can get a scrollable ResultSet for example with this declaration:
statement = connection.createStatement(resultSet.TYPE_SCROLL_SENSITIVE,resultSet.CONCUR_READ_ONLY);
Now you can go forward and/or backward with the methods of ResultSet.
Usambara Veilchen
Greenhorn

Joined: Dec 07, 2000
Posts: 5
In a default ResulSet you can only go forward, but you can get a scrollable ResultSet for example with this declaration:
statement = connection.createStatement(resultSet.TYPE_SCROLL_SENSITIVE,resultSet.CONCUR_READ_ONLY);
Now you can go forward and/or backward with the methods of ResultSet.
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, wrox's Professional Java Server Programming J2EE says
TYPE_SCROLL_INSENSITIVE : supports scrolling both directions.
TYPE_SCROLL_SENSITIVE: This result set of this type is sensitive to updates made to the data after the result set has been populated. For instance, if your result set returns 10 rows, and if another application removes 2 of the rows, your result set will only have 8 rows.
Does that mean a TYPE_SCROLL_SNSITIVE result set is sensitive to changes made by another application even after the result set had been retrieved?
Raja Shekhar
Ranch Hand

Joined: Apr 02, 2001
Posts: 49
Hi Park....
this facility is available with JDBC 2.0 only...rite...
Please Let me know//////
Raj
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scrolable ResultSet