• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBCRowSet (Scrollable or not)

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am reading Java Tutorials - JDBC. Here I read that JDBC RowSet objects "Add Scrollability and Updatability".
However when I read about JDBCRowSetImp I find the following: "The ResultSet object that is passed to the JDBCRowSetImpl constructor must be scrollable" and "if you have run the method createStatement [yo create a ResultSet] without any arguments (ResultSet.TYPE_SCROLL_SENSITIVE), the ResultSet would not be scrollable and neither would the JDBCRowSet".

So my question is; In what case will a JDBCRowSet Add Scrollability?
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Simon,

From documentation of java.sql.ResultSet:

In a scrollable ResultSet object, the cursor can be moved backwards and forwards, to an absolute position, or to a position relative to the current row.



By default the ResultSet object contains a cursor pointing to beginning and it moves forward only. Also, it can be iterated only once. Thus, to add more functionality (e.g. to move backwards, or to iterate it more than once), 'scrollable' comes into picture.

I hope this helps.
 
Simon Joseph Aquilina
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anayonkar Shivalkar wrote:By default the ResultSet object contains a cursor pointing to beginning and it moves forward only. Also, it can be iterated only once. Thus, to add more functionality (e.g. to move backwards, or to iterate it more than once), 'scrollable' comes into picture.



However the book I am reading seems to be saying that JDBCRowSet will not be scrollable when the ResultSet it wraps is not also scrollable.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic