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

Scrolable ResultSet

 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Park....
this facility is available with JDBC 2.0 only...rite...
Please Let me know//////
Raj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic