javax.infobus
Interface ScrollableRowsetAccess


public abstract interface ScrollableRowsetAccess
extends RowsetAccess

DataItems that implement the ScrollableRowsetAcess interface represent a set of rows that may be naviagated backwards or forwards. The ScrollableRowsetAccess interface contains methods to get a new cursor, to set and get the number of rows to be locally buffered, to go to the first/last/previous/specified row, and to get the number of rows.


Method Summary
 boolean absolute(int rowIndex)
          Set the row cursor to the specified row If there are changes to the current row pending, the producer may validate the changes and/or send them to the database before changing the cursor.
 boolean first()
          Move the row cursor to the first row.
 int getBufferSize()
          Get the current buffer size.
 int getRow()
          Get the row number of the current row.
 int getRowCount()
          Get the total number of rows in the rowset.
 boolean last()
          Move the row cursor to the last row.
 ScrollableRowsetAccess newCursor()
          Get a new, independent cursor for the rowset.
 boolean previous()
          Move the row cursor to the previous row.
 boolean relative(int numRows)
          Move the row cursor forwards or backwards by the specified number of rows.
 void setBufferSize(int size)
          Ask the data provider to keep a specified number of rows immediately available.
 
Methods inherited from interface javax.infobus.RowsetAccess
canDelete, canInsert, canUpdate, canUpdate, canUpdate, deleteRow, flush, getColumnCount, getColumnDatatypeName, getColumnDatatypeNumber, getColumnItem, getColumnItem, getColumnName, getDb, getHighWaterMark, hasMoreRows, lockRow, newRow, next, setColumnValue, setColumnValue
 

Method Detail

newCursor

public ScrollableRowsetAccess newCursor()
Get a new, independent cursor for the rowset.
Returns:
a new ScrollableRowsetAccess object having the same underlying set of rows

setBufferSize

public void setBufferSize(int size)
Ask the data provider to keep a specified number of rows immediately available. Does nothing if not supported.
Parameters:
size - number of rows to keep immediately available.

getBufferSize

public int getBufferSize()
Get the current buffer size. If the provider does not support setting the buffer this, this will be 1.
Returns:
current buffere size.

previous

public boolean previous()
                 throws java.sql.SQLException,
                        RowsetValidationException
Move the row cursor to the previous row. If there are changes to the current row pending, the producer may validate the changes and/or send them to the database before changing the cursor.
Returns:
true if there is a previous row, false otherwise.
Throws:
java.sql.SQLException - if the backend rejects the changes
RowsetValidationException - if the changes are invalid

first

public boolean first()
              throws java.sql.SQLException,
                     RowsetValidationException
Move the row cursor to the first row. If there are changes to the current row pending, the producer may validate the changes and/or send them to the database before changing the cursor.
Returns:
true if there is a first row, false if there are no rows.
Throws:
java.sql.SQLException - if the backend rejects the changes
RowsetValidationException - if the changes are invalid

last

public boolean last()
             throws java.sql.SQLException,
                    RowsetValidationException
Move the row cursor to the last row. If there are changes to the current row pending, the producer may validate the changes and/or send them to the database before changing the cursor.
Returns:
true if there is a last row, false if there are no rows.
Throws:
java.sql.SQLException - if the backend rejects the changes
RowsetValidationException - if the changes are invalid

relative

public boolean relative(int numRows)
                 throws java.sql.SQLException,
                        RowsetValidationException
Move the row cursor forwards or backwards by the specified number of rows. If there are changes to the current row pending, the producer may validate the changes and/or send them to the database before changing the cursor.
Parameters:
numRows - the number of rows to move forward (backwards if negative).
Returns:
true if the specified row exists, false otherwise.
Throws:
java.sql.SQLException - if the backend rejects the changes
RowsetValidationException - if the changes are invalid

getRow

public int getRow()
Get the row number of the current row.
Returns:
a number greater than 0 if there is a current row, else 0.

getRowCount

public int getRowCount()
Get the total number of rows in the rowset.
Returns:
number of rows

absolute

public boolean absolute(int rowIndex)
                 throws java.sql.SQLException,
                        RowsetValidationException
Set the row cursor to the specified row If there are changes to the current row pending, the producer may validate the changes and/or send them to the database before changing the cursor.
Parameters:
rowIndex - the number of the row as returned by getRow.
Returns:
true if the specified row exisits, false otherwise.
Throws:
java.sql.SQLException - if the backend rejects the changes
RowsetValidationException - if the changes are invalid