All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface javax.infobus.RowsetAccess

public interface RowsetAccess
DataItems that implement the RowsetAcess interface represent a set of rows resulting from a query against a database. The RowsetAccess interface contains methods to get metadata (number of columns, plus column names and datatypes), to read the rows, to extract column values, to update rows, to validate changes and send changes to the database, and to obtain a DbAccess object for the associated database.

Version:
$Revision: 1.13 $

Method Index

 o canDelete()
Determine if deleting rows is allowed
 o canInsert()
Determine if inserting rows is allowed
 o canUpdate()
Returns true if modifying the items in all columns in the existing rows is allowed, false otherwise.
 o canUpdate(int)
Returns true if modifying the items in the specified column is allowed, false otherwise.
 o canUpdate(String)
Returns true if modifying the items in the specified column is allowed, false otherwise.
 o deleteRow()
Delete the current row.
 o flush()
Flush all changes to the underlying database.
 o getColumnCount()
Returns the number of columns in the rowset.
 o getColumnDatatypeName(int)
Given the one based column index, returns the column's data source specific type name.
 o getColumnDatatypeNumber(int)
Given the one based columnIndex, returns the data type for the column using the encoding specified by java.sql.Types
 o getColumnItem(int)
Given the one based column index, returns an Object which can be used to obtain the current value of the specified column.
 o getColumnItem(String)
Given the name of the column, returns an Object which can be used to obtain the current value of the column.
 o getColumnName(int)
Returns the name of the column indicated by columnIndex if a name is available.
 o getDb()
Get the RowsetAccess item's database
 o getHighWaterMark()
Return the total number of rows known to the producer so far.
 o hasMoreRows()
Return true if there may be more rows to fetch.
 o lockRow()
Lock the current row.
 o newRow()
Create a new, empty row and set the row cursor to this row.
 o next()
Advances the row cursor to the next row.
 o setColumnValue(int, Object)
Given the one-based index of a column, set the value of the column in the current row.
 o setColumnValue(String, Object)
Given the name of a column, set the value of the column in the current row.

Methods

 o getColumnCount
 public abstract int getColumnCount()
Returns the number of columns in the rowset.

Returns:
number of columns
 o getColumnName
 public abstract String getColumnName(int columnIndex) throws IndexOutOfBoundsException
Returns the name of the column indicated by columnIndex if a name is available. Some calculated columns may have no name.

Parameters:
columnIndex - a one-based index of a rowset column
Returns:
the name of the corresponding column, or null if no name is available
Throws: IndexOutOfBoundsException
if columnIndex falls outside the range of valid indexes for this rowset
 o getColumnDatatypeNumber
 public abstract int getColumnDatatypeNumber(int columnIndex) throws IndexOutOfBoundsException
Given the one based columnIndex, returns the data type for the column using the encoding specified by java.sql.Types

Parameters:
columnIndex - a one-based index of a rowset column
Returns:
the encoding for the indicated column. See java.sql.types.
Throws: IndexOutOfBoundsException
if columnIndex falls outside the range of valid indexes for this rowset
 o getColumnDatatypeName
 public abstract String getColumnDatatypeName(int columnIndex) throws IndexOutOfBoundsException
Given the one based column index, returns the column's data source specific type name. See java.sql.ResultSetMetaData.

Parameters:
columnIndex - a one-based index of a rowset column
Returns:
the source specific type name
Throws: IndexOutOfBoundsException
if columnIndex falls outside the range of valid indexes for this rowset
 o next
 public abstract boolean next() throws SQLException, RowsetValidationException
Advances the row cursor to the next row. Returns true if the call has advanced the cursor to a new row, false if the call has advanced the cursor beyond the last row. It is valid for a rowset to contain zero rows, so the first call to nextRow may return false. Changing the row cursor may propagate a new or updated row to the backing store, and this may cause an exception.

Returns:
true if the new row is available, false if the cursor has advanced past the last row
Throws: SQLException
if a new or updated row implicitly submitted to the backend is rejected.
Throws: RowsetValidationException
if a new or updated row implicitly submitted to the data producer is invalid.
 o getHighWaterMark
 public abstract int getHighWaterMark()
Return the total number of rows known to the producer so far. This is generally be less than the total number of rows until the last row or "chunk" of rows has been fetched by the producer. This should not throw an exception.

Returns:
number of rows
 o hasMoreRows
 public abstract boolean hasMoreRows()
Return true if there may be more rows to fetch. This is conservative -- the producer may return true after fetching the last row before discovering it was the last row.

Returns:
true if there may be more rows to fetch.
 o getColumnItem
 public abstract Object getColumnItem(int columnIndex) throws IndexOutOfBoundsException, SQLException
Given the one based column index, returns an Object which can be used to obtain the current value of the specified column. The Object usually implments the ImmediateAccess interface. The value changes as nextRow is called, that is the Object tracks the current row.

Parameters:
columnIndex - the index of the column desired
Returns:
the data in that column
Throws: IndexOutOfBoundsException
if columnIndex falls outside the range of valid indexes for this rowset
Throws: SQLException
if a new or updated row implicitly submitted to the backend is rejected, and also for other backend errors.
 o getColumnItem
 public abstract Object getColumnItem(String columnName) throws ColumnNotFoundException, DuplicateColumnException, SQLException
Given the name of the column, returns an Object which can be used to obtain the current value of the column. This Object usually implements the ImmediateAccess interface. The value changes as nextRow is called, that is the Object tracks the current row.

Parameters:
columnName - the name of the column desired
Returns:
the data in that column
Throws: ColumnNotFoundException
if a column matching colName is not present in the rowset
Throws: DuplicateColumnException
if more than one column in the rowset matches colName
Throws: SQLException
if a new or updated row implicitly submitted to the backend is rejected, and also for other backend errors.
 o newRow
 public abstract void newRow() throws SQLException, RowsetValidationException
Create a new, empty row and set the row cursor to this row. May implicitly submit a previous new or modified row to the backend, and this may cause an exception.

Throws: SQLException
if a new or updated row implicitly submitted to the backend is rejected, and also for other backend errors.
Throws: RowsetValidationException
if a new or updated row implicitly submitted to the data producer is invalid.
 o setColumnValue
 public abstract void setColumnValue(int columnIndex,
                                     Object object) throws IndexOutOfBoundsException, SQLException, RowsetValidationException
Given the one-based index of a column, set the value of the column in the current row. Note that this may also be done via ImmediateAccess.setValue.

Parameters:
columnIndex - one-based column number
object - new value for the column
Throws: IndexOutOfBoundsException
if the column index is not valid
Throws: SQLException
if the backend rejects the change
Throws: RowsetValidationException
if the new value is invalid
 o setColumnValue
 public abstract void setColumnValue(String columnName,
                                     Object object) throws ColumnNotFoundException, DuplicateColumnException, SQLException, RowsetValidationException
Given the name of a column, set the value of the column in the current row.

Parameters:
columnName - the name of the column
object - new value for column
Throws: ColumnNotFoundException
if a column matching colName is not present in the rowset
Throws: DuplicateColumnException
if more than one column in the rowset matches colName
Throws: SQLException
if the backend rejects the change
Throws: RowsetValidationException
if the new value is invalid
 o deleteRow
 public abstract void deleteRow() throws SQLException, RowsetValidationException
Delete the current row.

Throws: SQLException
if the backend rejects the deletion
Throws: RowsetValidationException
if the deletion is invalid
 o flush
 public abstract void flush() throws SQLException, RowsetValidationException
Flush all changes to the underlying database.

Throws: SQLException
if the backend rejects some change
Throws: RowsetValidationException
if the change is invalid
 o lockRow
 public abstract void lockRow() throws SQLException, RowsetValidationException
Lock the current row. Does nothing if this is not supported by the producer.

Throws: SQLException
if a backend error occurred
Throws: RowsetValidationException
if the operation is invalid
 o canInsert
 public abstract boolean canInsert()
Determine if inserting rows is allowed

Returns:
true if inserting rows is allowed, false otherwise
 o canUpdate
 public abstract boolean canUpdate()
Returns true if modifying the items in all columns in the existing rows is allowed, false otherwise.

Returns:
true if updating all rows is allowed, false otherwise
 o canUpdate
 public abstract boolean canUpdate(String columnName) throws ColumnNotFoundException, DuplicateColumnException
Returns true if modifying the items in the specified column is allowed, false otherwise.

Returns:
true if updating the specified column is allowed, false otherwise
Throws: ColumnNotFoundException
if the named column was not found
Throws: DuplicateColumnNameException
if there of multiple columns with the specified name.
 o canUpdate
 public abstract boolean canUpdate(int columnNumber) throws IndexOutOfBoundsException
Returns true if modifying the items in the specified column is allowed, false otherwise.

Returns:
true if updating the specified column is allowed, false otherwise
Throws: IndexOutOfBoundsException
if the supplied column number is out of range
 o canDelete
 public abstract boolean canDelete()
Determine if deleting rows is allowed

Returns:
true if deleting rows is allowed, false otherwise
 o getDb
 public abstract DbAccess getDb()
Get the RowsetAccess item's database

Returns:
an instance of DbAccess representing the database associated with the RowsetAccess item

All Packages  Class Hierarchy  This Package  Previous  Next  Index