|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.sql.rowset.BaseRowSet com.sun.sql.rowset.BaseRowSetX com.sun.sql.rowset.CachedRowSetXImpl
The reference implementation of the CachedRowSetX
interface. See the interface
defintion for full behavior and implementation requirements.
Note: This implemenation is based on the Sun Microsystems Reference Implemenation of
CachedRowSet
Field Summary | |
protected boolean |
internalUseInstance
The internalUseInstance flag tells to ignore exceptional conditions
with regard to the rowset not being executed. |
Fields inherited from class javax.sql.rowset.BaseRowSet |
ASCII_STREAM_PARAM, asciiStream, BINARY_STREAM_PARAM, binaryStream, charStream, UNICODE_STREAM_PARAM, unicodeStream |
Fields inherited from interface javax.sql.rowset.CachedRowSet |
COMMIT_ON_ACCEPT_CHANGES |
Fields inherited from interface java.sql.ResultSet |
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE |
Constructor Summary | |
CachedRowSetXImpl()
Constructs a default CachedRowSetXImpl object instance. |
|
CachedRowSetXImpl(java.util.Hashtable env)
Provides a CachedRowSetXImpl instance with the same default properties as
as the zero parameter constructor. |
Method Summary | |
boolean |
absolute(int row)
|
void |
acceptChanges()
Propagates row update, insert and delete changes made to this CachedRowSet object to the underlying data source.
This method calls on this
When the method
Depending on the synchronization level of the
An application may choose to catch the
Some provider implementations may use locks to ensure that there are no
conflicts. In such cases, it is guaranteed that the writer will succeed in
writing changes to the data source when the method
Note: The |
void |
acceptChanges(java.sql.Connection con)
Propagates all row update, insert and delete changes to the data source backing this CachedRowSet object
using the specified Connection object to establish a
connection to the data source.
The other version of the
This form of the method
When the method
Depending on the synchronization level of the
An application may choose to catch the
Some provider implementations may use locks to ensure that there are no
conflicts. In such cases, it is guaranteed that the writer will succeed in
writing changes to the data source when the method
Note: The |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
The listener is registered for all bound properties. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. The listener will be invoked only on a change of the specific property. |
void |
afterLast()
|
void |
beforeFirst()
|
void |
cancelRowUpdates()
|
void |
clearWarnings()
|
protected java.lang.Object |
clone()
Returns a new RowSet object containing by the same data
as this CachedRowSetXImpl object. |
void |
close()
|
boolean |
columnUpdated(int idx)
Indicates whether the designated column in the current row of this CachedRowSet object has been updated. |
boolean |
columnUpdated(java.lang.String columnName)
Indicates whether the designated column in the current row of this CachedRowSet object has been updated. |
void |
commit()
Each CachedRowSet object's SyncProvider contains
a Connection object from the ResultSet or JDBC
properties passed to it's constructors. |
CachedRowSet |
createCopy()
Creates a RowSet object that is a deep copy of
a CachedRowSet object instance data. In contrast to
the RowSet generated from a createShared
call, updates made to the copy of the original RowSet
must not be visible to original RowSet . Equally any
event listeners that are registered with the original
RowSet must not have scope over the new
RowSet copies. In addition any constraint restrictions
established must be maintained. |
CachedRowSet |
createCopyNoConstraints()
Creates a RowSet object that is a deep copy of
a CachedRowSet object instance data. In contrast to
the RowSet generated from a createShared
call, updates made to the copy of the original RowSet
must not be visible to original RowSet . Equally any
event listeners that are registered with the original
RowSet must not have scope over the new
RowSet copies. In addition any constraint restrictions
established must not be maintained. |
CachedRowSet |
createCopySchema()
Creates an empty copy of the CachedRowSet object
instance. Any copies
must not contain any contents but only represent the table
structure of the original RowSet. In addition, primary or foreign
key constraints set in the originating RowSet must
equally enforced in the new empty CachedRowSet .
In contrast to
the RowSet generated from a createShared
call, updates made to the copy of the original RowSet
must not be visible to original RowSet .
Applications can form a |
static CachedRowSetXImpl |
createInternalUseInstance()
used internally by readers and writers |
javax.sql.RowSet |
createShared()
Returns a new RowSet object backed by the same data as
that of this CachedRowSet object. In effect, both
CachedRowSet objects have a cursor over the same data.
As a result, any changes made by a duplicate are visible to the original
and to any other duplicates, just as a change made by the original is visible
to all of its duplicates. If a duplicate calls a method that changes the
underlying data, the method it calls notifies all registered listeners
just as it would when it is called by the original CachedRowSet
object.
In addition, any
NOTE: If multiple threads access |
void |
deleteRow()
|
void |
execute()
|
void |
execute(java.sql.Connection conn)
Populates this CachedRowSet object with data, using the
given connection to produce the result set from which the data will be read.
This method should close any database connections that it creates to
ensure that this CachedRowSet object is disconnected except when
it is reading data from its data source or writing data to its data source.
The reader for this
If this method is called when an implementation has already been
populated, the contents and the metadata are (re)set. Also, if this method is
called before the method |
int |
findColumn(java.lang.String columnName)
|
boolean |
first()
|
java.sql.Array |
getArray(int columnIndex)
|
java.sql.Array |
getArray(java.lang.String colName)
|
java.io.InputStream |
getAsciiStream(int columnIndex)
|
java.io.InputStream |
getAsciiStream(java.lang.String columnName)
|
java.math.BigDecimal |
getBigDecimal(int columnIndex)
|
java.math.BigDecimal |
getBigDecimal(int columnIndex,
int scale)
|
java.math.BigDecimal |
getBigDecimal(java.lang.String columnName)
|
java.math.BigDecimal |
getBigDecimal(java.lang.String columnName,
int scale)
|
java.io.InputStream |
getBinaryStream(int columnIndex)
|
java.io.InputStream |
getBinaryStream(java.lang.String columnName)
|
java.sql.Blob |
getBlob(int columnIndex)
|
java.sql.Blob |
getBlob(java.lang.String colName)
|
boolean |
getBoolean(int columnIndex)
|
boolean |
getBoolean(java.lang.String columnName)
|
byte |
getByte(int columnIndex)
|
byte |
getByte(java.lang.String columnName)
|
byte[] |
getBytes(int columnIndex)
|
byte[] |
getBytes(java.lang.String columnName)
|
java.lang.String |
getCatalogName()
Returns the catalog in which the table referred to by the tableName property
resides.
|
java.io.Reader |
getCharacterStream(int columnIndex)
|
java.io.Reader |
getCharacterStream(java.lang.String columnName)
|
java.sql.Clob |
getClob(int columnIndex)
|
java.sql.Clob |
getClob(java.lang.String colName)
|
java.lang.String[] |
getColumnCatalogNames()
Returns an array of String . If setColumnCatalogNames was never called,
null is returned, else the value set when calling
setColumnCatalogNames{/code> is returned. See |
java.lang.String |
getColumnCatalogNames(int index)
Returns a String which contains the catalog name set for the column or
null .
Note, the column is zero based whereas most jdbc calls are one based. |
java.lang.String[] |
getColumnNames()
Returns an array of String . If setColumnNames was never called,
null is returned, else the value set when calling
setColumnNames{/code> is returned. See |
java.lang.String |
getColumnNames(int index)
Returns a String which contains the column name set for the column or
null .
Note, the column is zero based whereas most jdbc calls are one based. |
java.lang.String[] |
getColumnSchemaNames()
Returns an array of String . If setColumnSchemaNames was never called,
null is returned, else the value set when calling
setColumnSchemaNames{/code> is returned. See |
java.lang.String |
getColumnSchemaNames(int index)
Returns a String which contains the schema name set for the column or
null .
Note, the column is zero based whereas most jdbc calls are one based. |
java.lang.String[] |
getColumnTableNames()
Returns an array of String . If setColumnTableNames was never called,
null is returned, else the value set when calling
setColumnTableNames{/code> is returned. See |
java.lang.String |
getColumnTableNames(int index)
Returns a String which contains the table name set for the column or
null .
Note, the column is zero based whereas most jdbc calls are one based. |
java.sql.Connection |
getConnection()
Retrieves the Connection object passed to this
CachedRowSetXImpl object. |
protected BaseRow |
getCurrentRow()
Returns the insert row or the current row of this CachedRowSetXImpl object. |
java.lang.String |
getCursorName()
|
java.sql.Date |
getDate(int columnIndex)
|
java.sql.Date |
getDate(int columnIndex,
java.util.Calendar cal)
|
java.sql.Date |
getDate(java.lang.String columnName)
|
java.sql.Date |
getDate(java.lang.String columnName,
java.util.Calendar cal)
|
double |
getDouble(int columnIndex)
|
double |
getDouble(java.lang.String columnName)
|
float |
getFloat(int columnIndex)
|
float |
getFloat(java.lang.String columnName)
|
boolean[] |
getInsertableColumns()
Returns an array of boolean{/code>. If |
boolean |
getInsertableColumns(int index)
Returns a boolean{/code> of |
int |
getInt(int columnIndex)
|
int |
getInt(java.lang.String columnName)
|
int[] |
getKeyColumns()
Returns an array containing one or more column numbers indicating the columns that form a key that uniquely identifies a row in this CachedRowSet object. |
long |
getLong(int columnIndex)
|
long |
getLong(java.lang.String columnName)
|
int[] |
getMatchColumnIndexes()
Retrieves the index of the match column that was set for this RowSet object with the method
setMatchColumn(int columnIdx) . |
java.lang.String[] |
getMatchColumnNames()
Retrieves the name of the match column that was set for this RowSet object with the method
setMatchColumn(String columnName) . |
java.sql.ResultSetMetaData |
getMetaData()
|
java.lang.Object |
getObject(int columnIndex)
|
java.lang.Object |
getObject(int columnIndex,
java.util.Map map)
|
java.lang.Object |
getObject(java.lang.String columnName)
|
java.lang.Object |
getObject(java.lang.String columnName,
java.util.Map map)
|
java.sql.ResultSet |
getOriginal()
Returns a ResultSet object containing the original value of this
CachedRowSet object. |
java.sql.ResultSet |
getOriginalRow()
Returns a ResultSet object containing the original value for the
current row only of this CachedRowSet object. |
int |
getPageSize()
Returns the page-size for the CachedRowSet object |
boolean |
getPrintStatements()
Returns the printStatements property. |
java.sql.Ref |
getRef(int columnIndex)
|
java.sql.Ref |
getRef(java.lang.String colName)
|
int |
getRow()
|
RowSetWarning |
getRowSetWarnings()
Retrieves the first warning reported by calls on this RowSet object. |
java.lang.String |
getSchemaName()
Returns the schema in which the table referred to by the tableName property
resides.
|
short |
getShort(int columnIndex)
|
short |
getShort(java.lang.String columnName)
|
java.sql.Statement |
getStatement()
Returns null . |
java.lang.String |
getString(int columnIndex)
|
java.lang.String |
getString(java.lang.String columnName)
|
SyncProvider |
getSyncProvider()
Retrieves the SyncProvider implementation for this
CachedRowSet object. Internally, this method is used by a rowset
to trigger read or write actions between the rowset
and the data source. For example, a rowset may need to get a handle
on the the rowset reader (RowSetReader object) from the
SyncProvider to allow the rowset to be populated.
RowSetReader rowsetReader = null; SyncProvider provider = SyncFactory.getInstance("javax.sql.rowset.provider.RIOptimisticProvider"); if (provider instanceof RIOptimisticProvider) { rowsetReader = provider.getRowSetReader(); }Assuming rowsetReader is a private, accessible field within the rowset implementation, when an application calls the execute
method, it in turn calls on the reader's readData method
to populate the RowSet object.
rowsetReader.readData((RowSetInternal)this);
In addition, an application can use the |
java.lang.String |
getTableName()
Returns an identifier for the object (table) that was used to create this CachedRowSet object. |
java.sql.Time |
getTime(int columnIndex)
|
java.sql.Time |
getTime(int columnIndex,
java.util.Calendar cal)
|
java.sql.Time |
getTime(java.lang.String columnName)
|
java.sql.Time |
getTime(java.lang.String columnName,
java.util.Calendar cal)
|
java.sql.Timestamp |
getTimestamp(int columnIndex)
|
java.sql.Timestamp |
getTimestamp(int columnIndex,
java.util.Calendar cal)
|
java.sql.Timestamp |
getTimestamp(java.lang.String columnName)
|
java.sql.Timestamp |
getTimestamp(java.lang.String columnName,
java.util.Calendar cal)
|
java.io.InputStream |
getUnicodeStream(int columnIndex)
|
java.io.InputStream |
getUnicodeStream(java.lang.String columnName)
|
boolean[] |
getUpdatableColumns()
Returns an array of boolean{/code>. If |
boolean |
getUpdatableColumns(int index)
Returns a boolean{/code> of |
java.net.URL |
getURL(int columnIndex)
|
java.net.URL |
getURL(java.lang.String columnName)
|
java.sql.SQLWarning |
getWarnings()
|
protected void |
initParams()
Performs the necessary internal configurations and initializations to allow any JDBC RowSet implementation to start using
the standard facilities provided by a BaseRowSet
instance. |
void |
insertRow()
|
protected boolean |
internalFirst()
|
protected boolean |
internalLast()
|
protected boolean |
internalNext()
Moves this CachedRowSetXImpl object's cursor to the next
row and returns true if the cursor is still in the rowset;
returns false if the cursor has moved to the position after
the last row. |
protected boolean |
internalPrevious()
|
boolean |
isAfterLast()
|
boolean |
isBeforeFirst()
|
boolean |
isExecuted()
Returns true if this rowset is in an executed state |
boolean |
isFirst()
|
boolean |
isLast()
|
boolean |
last()
|
void |
moveToCurrentRow()
|
void |
moveToInsertRow()
|
boolean |
next()
|
boolean |
nextPage()
Increments the current page of the CachedRowSet . |
void |
populate(java.sql.ResultSet data)
Populates this CachedRowSet object with data from
the given ResultSet object.
This method can be used as an alternative to the |
void |
populate(java.sql.ResultSet data,
int start)
Populates this CachedRowSet object with data from
the given ResultSet object. |
boolean |
previous()
|
boolean |
previousPage()
Decrements the current page of the CachedRowSet . |
void |
refreshRow()
|
boolean |
relative(int rows)
|
void |
release()
Releases the current contents of this CachedRowSet
object and sends a rowSetChanged event to all
registered listeners. Any outstanding updates are discarded and
the rowset contains no rows after this method is called. There
are no interactions with the underlying data source, and any rowset
content, metadata, and content updates should be non-recoverable.
This
The metadata, including JDBC properties and Synchronization SPI
properties, are maintained for future use. It is important that
properties such as the
This method empties a rowset, as opposed to the |
protected void |
removeCurrentRow()
Removes the row on which the cursor is positioned. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. |
void |
restoreOriginal()
Restores this CachedRowSet object to its original
value, that is, its value before the last set of changes. If there
have been no changes to the rowset or only one set of changes,
the original value is the value with which this CachedRowSet object
was populated; otherwise, the original value is
the value it had immediately before its current value.
When this method is called, a |
void |
rollback()
Each CachedRowSet object's SyncProvider contains
a Connection object from the original ResultSet
or JDBC properties passed to it. |
void |
rollback(java.sql.Savepoint s)
Each CachedRowSet object's SyncProvider contains
a Connection object from the original ResultSet
or JDBC properties passed to it. |
boolean |
rowDeleted()
|
boolean |
rowInserted()
|
void |
rowSetPopulated(javax.sql.RowSetEvent event,
int numRows)
Notifies registered listeners that a RowSet object in the given RowSetEvent object has populated a number of additional rows. |
boolean |
rowUpdated()
|
void |
setCatalogName(java.lang.String catalogName)
Sets the identifier for catalog of the table referred to in the tableName
property.
The writer uses this name to determine which table to use when comparing the values in
the data source with the CachedRowSetX object's values during a
synchronization attempt.
The catalogName property also indicates where modified values from this
CachedRowSetX object should be written.
The implementation of this
Note: This method is called by |
void |
setColumnCatalogNames(int index,
java.lang.String columnCatalogName)
Set the columnCatalogNames property. |
void |
setColumnCatalogNames(java.lang.String[] columnCatalogNames)
Set the columnCatalogNames property. |
void |
setColumnNames(int index,
java.lang.String columnName)
Set the columnNames property. |
void |
setColumnNames(java.lang.String[] columnNames)
Set the columnNames property. |
void |
setColumnSchemaNames(int index,
java.lang.String columnSchemaName)
Set the columnSchemaNames property. |
void |
setColumnSchemaNames(java.lang.String[] columnSchemaNames)
Set the columnSchemaNames property. |
void |
setColumnTableNames(int index,
java.lang.String columnTableName)
Set the columnTableNames property. |
void |
setColumnTableNames(java.lang.String[] columnTableNames)
Set the columnTableNames property. |
void |
setCommand(java.lang.String command)
Sets this RowSet object's command property to
the given String object and clears the parameters, if any,
that were set for the previous command.
The |
void |
setConcurrency(int concurrency)
Sets the concurrency for this RowSet object to
the specified concurrency. The default concurrency for any RowSet
object (connected or disconnected) is ResultSet.CONCUR_UPDATABLE ,
but this method may be called at any time to change the concurrency.
|
void |
setDataSourceName(java.lang.String dataSourceName)
Sets the DataSource name property for this RowSet
object to the given logical name and sets this RowSet object's
Url property to null . The name must have been bound to a
DataSource object in a JNDI naming service so that an
application can do a lookup using that name to retrieve the
DataSource object bound to it. The DataSource
object can then be used to establish a connection to the data source it
represents.
Users should set either the Url property or the dataSourceName property. If both properties are set, the driver will use the property set most recently. |
void |
setInsertableColumns(boolean[] insertableColumns)
Set the insertableColumns property. |
void |
setInsertableColumns(int index,
boolean insertableColumn)
Set the insertableColumns property. |
void |
setKeyColumns(int[] keys)
Sets this CachedRowSet object's keyCols
field with the given array of column numbers, which forms a key
for uniquely identifying a row in this rowset. |
void |
setMatchColumn(int columnIdx)
Sets the designated column as the match column for this RowSet
object. |
void |
setMatchColumn(int[] columnIdxes)
Sets the designated columns as the match column for this RowSet
object. |
void |
setMatchColumn(java.lang.String columnName)
Sets the designated column as the match column for this RowSet
object. |
void |
setMatchColumn(java.lang.String[] columnNames)
Sets the designated columns as the match column for this RowSet
object. |
void |
setMaxRows(int maxRows)
Sets the maximum number of rows that this RowSet object may contain to
the given number. If this limit is exceeded, the excess rows are
silently dropped. |
void |
setMetaData(javax.sql.RowSetMetaData md)
Sets the metadata for this CachedRowSet object with
the given RowSetMetaData object. |
void |
setOriginal()
|
void |
setOriginalRow()
Sets the current row in this CachedRowSet object as the original
row. |
void |
setPageSize(int size)
Sets the CachedRowSet object's page-size. |
void |
setPassword(java.lang.String password)
Sets the password used to create a database connection for this RowSet object to the given String
object. Because the password property is not
serialized, it is set at run time before calling the method
execute . |
void |
setPrintStatements(boolean printStatements)
Sets the printStatements property.
If this property is true ,
SQL Insert , UPDATE and DELETE statements will
be written to System.out . This property is intended to be set when debugging
problems inserting, updating and deleting. With the information gained from examining the
output, it is intended that one can set the other advanced properties on the
CachedRowSetX to "fix" the SQL statements being generated. In this way,
some JDBC driver problems can be overcome.
|
void |
setReadOnly(boolean isReadOnly)
Sets this RowSet object's readOnly property to the given boolean . |
void |
setSchemaName(java.lang.String schemaName)
Sets the identifier for schema of the table referred to in the tableName
property.
The writer uses this name to determine which table to use when comparing the values in
the data source with the CachedRowSetX object's values during a
synchronization attempt.
The schemaName property also indicates where modified values from this
CachedRowSetX object should be written.
The implementation of this |
void |
setSyncProvider(java.lang.String providerStr)
Sets the SyncProvider objec for this CachedRowSet
object to the one specified. This method
allows the SyncProvider object to be reset.
A
Resetting the |
void |
setTableName(java.lang.String tabName)
Sets the identifier for the table from which this CachedRowSet
object was derived to the given table name. |
void |
setTransactionIsolation(int transactionIsolation)
Sets the transaction isolation property for this JDBC RowSet object to the given
constant. The DBMS will use this transaction isolation level for
transactions if it can.
For |
void |
setType(int type)
Sets the type for this RowSet object to the specified type.
The default type is ResultSet.TYPE_SCROLL_INSENSITIVE . |
void |
setUpdatableColumns(boolean[] updatableColumns)
Set the updatableColumns property. |
void |
setUpdatableColumns(int index,
boolean updatableColumn)
Set the updatableColumns property. |
void |
setUrl(java.lang.String url)
Sets the Url property for this RowSet object
to the given String object and sets the dataSource name
property to null . The Url property is a
JDBC URL that is used when
the connection is created using a JDBC technology-enabled driver
("JDBC driver") and the DriverManager .
The correct JDBC URL for the specific driver to be used can be found
in the driver documentation. Although there are guidelines for for how
a JDBC URL is formed,
a driver vendor can specify any String object except
one with a length of 0 (an empty string).
Setting the Url property is optional if connections are established using
a |
void |
setUsername(java.lang.String username)
Sets the username property for this RowSet object
to the given user name. Because it
is not serialized, the username property is set at run time before
calling the method execute . |
int |
size()
Returns the number of rows in this CachedRowSet
object. |
java.util.Collection |
toCollection()
Converts this CachedRowSet object to a Collection
object that contains all of the CachedRowSet object's values.
Implementations have some latitude in
how they can represent this Collection object because of the
abstract nature of the Collection framework.
Each row must be fully represented in either a
general purpose Collection implementation or a specialized
Collection implementation, such as a TreeMap
object or a Vector object.
An SQL NULL column value must be represented as a null
in the Java programming language.
The standard reference implementation for the
The |
java.util.Collection |
toCollection(int column)
Converts the designated column in this CachedRowSet object
to a Collection object. Implementations have some latitude in
how they can represent this Collection object because of the
abstract nature of the Collection framework.
Each column value should be fully represented in either a
general purpose Collection implementation or a specialized
Collection implementation, such as a Vector object.
An SQL NULL column value must be represented as a null
in the Java programming language.
The standard reference implementation uses a |
java.util.Collection |
toCollection(java.lang.String column)
Converts the designated column in this CachedRowSet object
to a Collection object. Implementations have some latitude in
how they can represent this Collection object because of the
abstract nature of the Collection framework.
Each column value should be fully represented in either a
general purpose Collection implementation or a specialized
Collection implementation, such as a Vector object.
An SQL NULL column value must be represented as a null
in the Java programming language.
The standard reference implementation uses a |
void |
undoDelete()
Cancels the deletion of the current row and notifies listeners that a row has changed. After this method is called, the current row is no longer marked for deletion. This method can be called at any time during the lifetime of the rowset. In addition, multiple cancellations of row deletions can be made by adjusting the position of the cursor using any of the cursor position control methods such as:
|
void |
undoInsert()
Immediately removes the current row from this CachedRowSet
object if the row has been inserted, and also notifies listeners that a
row has changed. This method can be called at any time during the
lifetime of a rowset and assuming the current row is within
the exception limitations (see below), it cancels the row insertion
of the current row.
In addition, multiple cancellations of row insertions can be made by adjusting the position of the cursor using any of the cursor position control methods such as:
|
void |
undoUpdate()
Immediately reverses the last update operation if the row has been modified. This method can be called to reverse updates on all columns until all updates in a row have been rolled back to their state just prior to the last synchronization ( acceptChanges ) or population. This method may also be called
while performing updates to the insert row.
|
void |
unsetMatchColumn(int columnIdx)
Unsets the designated column as the match column for this RowSet
object. |
void |
unsetMatchColumn(int[] columnIdxes)
Unsets the designated columns as the match column for this RowSet
object. |
void |
unsetMatchColumn(java.lang.String columnName)
Unsets the designated column as the match column for this RowSet
object. |
void |
unsetMatchColumn(java.lang.String[] columnIdxes)
Unsets the designated columns as the match column for this RowSet
object. |
void |
updateArray(int columnIndex,
java.sql.Array a)
|
void |
updateArray(java.lang.String columnName,
java.sql.Array a)
|
void |
updateAsciiStream(int columnIndex,
java.io.InputStream x,
int length)
|
void |
updateAsciiStream(java.lang.String columnName,
java.io.InputStream x,
int length)
|
void |
updateBigDecimal(int columnIndex,
java.math.BigDecimal x)
|
void |
updateBigDecimal(java.lang.String columnName,
java.math.BigDecimal x)
|
void |
updateBinaryStream(int columnIndex,
java.io.InputStream x,
int length)
|
void |
updateBinaryStream(java.lang.String columnName,
java.io.InputStream x,
int length)
|
void |
updateBlob(int columnIndex,
java.sql.Blob b)
|
void |
updateBlob(java.lang.String columnName,
java.sql.Blob b)
|
void |
updateBoolean(int columnIndex,
boolean x)
|
void |
updateBoolean(java.lang.String columnName,
boolean x)
|
void |
updateByte(int columnIndex,
byte x)
|
void |
updateByte(java.lang.String columnName,
byte x)
|
void |
updateBytes(int columnIndex,
byte[] x)
|
void |
updateBytes(java.lang.String columnName,
byte[] x)
|
void |
updateCharacterStream(int columnIndex,
java.io.Reader x,
int length)
|
void |
updateCharacterStream(java.lang.String columnName,
java.io.Reader reader,
int length)
|
void |
updateClob(int columnIndex,
java.sql.Clob c)
|
void |
updateClob(java.lang.String columnName,
java.sql.Clob c)
|
void |
updateDate(int columnIndex,
java.sql.Date x)
|
void |
updateDate(java.lang.String columnName,
java.sql.Date x)
|
void |
updateDouble(int columnIndex,
double x)
|
void |
updateDouble(java.lang.String columnName,
double x)
|
void |
updateFloat(int columnIndex,
float x)
|
void |
updateFloat(java.lang.String columnName,
float x)
|
void |
updateInt(int columnIndex,
int x)
|
void |
updateInt(java.lang.String columnName,
int x)
|
void |
updateLong(int columnIndex,
long x)
|
void |
updateLong(java.lang.String columnName,
long x)
|
void |
updateNull(int columnIndex)
|
void |
updateNull(java.lang.String columnName)
|
void |
updateObject(int columnIndex,
java.lang.Object x)
|
void |
updateObject(int columnIndex,
java.lang.Object x,
int scale)
|
void |
updateObject(java.lang.String columnName,
java.lang.Object x)
|
void |
updateObject(java.lang.String columnName,
java.lang.Object x,
int scale)
|
void |
updateRef(int columnIndex,
java.sql.Ref ref)
|
void |
updateRef(java.lang.String columnName,
java.sql.Ref ref)
|
void |
updateRow()
|
void |
updateShort(int columnIndex,
short x)
|
void |
updateShort(java.lang.String columnName,
short x)
|
void |
updateString(int columnIndex,
java.lang.String x)
|
void |
updateString(java.lang.String columnName,
java.lang.String x)
|
void |
updateTime(int columnIndex,
java.sql.Time x)
|
void |
updateTime(java.lang.String columnName,
java.sql.Time x)
|
void |
updateTimestamp(int columnIndex,
java.sql.Timestamp x)
|
void |
updateTimestamp(java.lang.String columnName,
java.sql.Timestamp x)
|
boolean |
wasNull()
|
Methods inherited from class com.sun.sql.rowset.BaseRowSetX |
getFetchDirection, getFetchSize, getMaxRows, setFetchDirection, setFetchSize |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.sql.rowset.CachedRowSet |
getShowDeleted, setShowDeleted |
Methods inherited from interface javax.sql.RowSet |
addRowSetListener, clearParameters, getCommand, getDataSourceName, getEscapeProcessing, getMaxFieldSize, getMaxRows, getPassword, getQueryTimeout, getTransactionIsolation, getTypeMap, getUrl, getUsername, isReadOnly, removeRowSetListener, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setEscapeProcessing, setFloat, setInt, setLong, setMaxFieldSize, setNull, setNull, setObject, setObject, setObject, setQueryTimeout, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setTypeMap |
Methods inherited from interface java.sql.ResultSet |
getConcurrency, getFetchDirection, getFetchSize, getType, setFetchDirection, setFetchSize |
Methods inherited from interface javax.sql.RowSetInternal |
getParams |
Field Detail |
protected boolean internalUseInstance
internalUseInstance
flag tells to ignore exceptional conditions
with regard to the rowset not being executed. We must do this because this class
is also used internally and methods are called that would result in a rowset not
executed sqlexception if the user called them.
Constructor Detail |
public CachedRowSetXImpl()
CachedRowSetXImpl
object instance.
Constructs a new default CachedRowSetXImpl
object with
the capacity to hold 100 rows. This new object has no metadata
and has the following default values:
cursorPos = 0 numRows = 0 showDeleted = false queryTimeout = 0 maxRows = 0 maxFieldSize = 0 rowSetType = ResultSet.TYPE_SCROLL_INSENSITIVE concurrency = ResultSet.CONCUR_UPDATABLE readOnly = false isolation = Connection.TRANSACTION_READ_COMMITTED escapeProcessing = true cursorPos = 0 absolutePos = 0 numRows = 0A
CachedRowSetXImpl
object is configured to use the default
RIOptimisticProvider
implementation to provide connectivity
and synchronization capabilities to the set data source.
public CachedRowSetXImpl(java.util.Hashtable env) throws java.sql.SQLException
CachedRowSetXImpl
instance with the same default properties as
as the zero parameter constructor.
cursorPos = 0 numRows = 0 showDeleted = false queryTimeout = 0 maxRows = 0 maxFieldSize = 0 rowSetType = ResultSet.TYPE_SCROLL_INSENSITIVE concurrency = ResultSet.CONCUR_UPDATABLE readOnly = false isolation = Connection.TRANSACTION_READ_COMMITTED escapeProcessing = true onInsertRow = false cursorPos = 0 absolutePos = 0 numRows = 0However, applications will have the means to specify at runtime the desired
SyncProvider
object.
For example, creating a CachedRowSetXImpl
object as follows ensures
that a it is established with the com.foo.provider.Impl
synchronization
implementation providing the synchronization mechanism for this disconnected
RowSet
object.
Hashtable env = new Hashtable(); env.put(javax.sql.rowset.spi.SyncFactory.ROWSET_PROVIDER_NAME, "com.foo.provider.Impl"); CachedRowSetXImpl crs = new CachedRowSet(env);
Calling this constructor with a null
parameter will
cause the SyncFactory
to provide the reference
optimistic provider com.sun.rowset.providers.RIOptimisticProvider
.
In addition, the following properties can be associated with the provider to assist in determining the choice of the synchronizaton provider such as:
ROWSET_SYNC_PROVIDER
- the property specifying the the
SyncProvider
class name to be instantiated by the
SyncFacttory
ROWSET_SYNC_VENDOR
- the property specifying the software
vendor associated with a SyncProvider
implementation.
ROWSET_SYNC_PROVIDER_VER
- the property specifying the
version of the SyncProvider
implementation provided by the
software vendor.
SyncFactory
and SyncProvider
specificiations later in this document.
env
- a Hashtable
object with a list of desired
synchronization providers
java.sql.SQLException
- if the requested provider cannot be found by the
synchonization factorySyncProvider
Method Detail |
public static CachedRowSetXImpl createInternalUseInstance()
protected void initParams()
BaseRowSet
RowSet
implementation to start using
the standard facilities provided by a BaseRowSet
instance. This method should be called after the RowSet
object
has been instantiated to correctly initialize all parameters. This method
should never be called by an application, but is called from with
a RowSet
implementation extending this class.
initParams
in class BaseRowSet
public boolean isExecuted() throws java.sql.SQLException
true
if this rowset is in an executed state
isExecuted
in interface CachedRowSetX
boolean
true
if the CachedRowSetX
is in a state where navigation and getters and setters can be called on rows
returned from the database (i.e., returns true
if execute()
or populate
has been called.
java.sql.SQLException
- if a database access error occurspublic void setDataSourceName(java.lang.String dataSourceName) throws java.sql.SQLException
DataSource
name property for this RowSet
object to the given logical name and sets this RowSet
object's
Url property to null
. The name must have been bound to a
DataSource
object in a JNDI naming service so that an
application can do a lookup using that name to retrieve the
DataSource
object bound to it. The DataSource
object can then be used to establish a connection to the data source it
represents.
Users should set either the Url property or the dataSourceName property. If both properties are set, the driver will use the property set most recently.
setDataSourceName
in interface javax.sql.RowSet
setDataSourceName
in class BaseRowSetX
dataSourceName
- a String
object with the name that can be supplied
to a naming service based on JNDI technology to retrieve the
DataSource
object that can be used to get a connection;
may be null
but must not be an empty string
java.sql.SQLException
- if there is a problem setting the
dataSourceName
property or name is an empty stringBaseRowSet.getDataSourceName()
public void setUrl(java.lang.String url) throws java.sql.SQLException
RowSet
object
to the given String
object and sets the dataSource name
property to null
. The Url property is a
JDBC URL that is used when
the connection is created using a JDBC technology-enabled driver
("JDBC driver") and the DriverManager
.
The correct JDBC URL for the specific driver to be used can be found
in the driver documentation. Although there are guidelines for for how
a JDBC URL is formed,
a driver vendor can specify any String
object except
one with a length of 0
(an empty string).
Setting the Url property is optional if connections are established using
a DataSource
object instead of the DriverManager
.
The driver will use either the URL property or the
dataSourceName property to create a connection, whichever was
specified most recently. If an application uses a JDBC URL, it
must load a JDBC driver that accepts the JDBC URL before it uses the
RowSet
object to connect to a database. The RowSet
object will use the URL internally to create a database connection in order
to read or write data.
setUrl
in interface javax.sql.RowSet
setUrl
in class BaseRowSetX
url
- a String
object that contains the JDBC URL
that will be used to establish the connection to a database for this
RowSet
object; may be null
but must not
be an empty string
java.sql.SQLException
- if an error occurs setting the Url property or the
parameter supplied is a string with a length of 0
(an
empty string)BaseRowSet.getUrl()
public void setUsername(java.lang.String username)
RowSet
object
to the given user name. Because it
is not serialized, the username property is set at run time before
calling the method execute
.
setUsername
in interface javax.sql.RowSet
setUsername
in class BaseRowSet
username
- the String
object containing the user name that
is supplied to the data source to create a connection. It may be null.BaseRowSet.getUsername()
public void setPassword(java.lang.String password)
RowSet
object to the given String
object. Because the password property is not
serialized, it is set at run time before calling the method
execute
.
setPassword
in interface javax.sql.RowSet
setPassword
in class BaseRowSet
password
- the String
object that represents the password
that is supplied to the database to create a connection. It may be
null.BaseRowSet.getPassword()
public void setType(int type) throws java.sql.SQLException
RowSet
object to the specified type.
The default type is ResultSet.TYPE_SCROLL_INSENSITIVE
.
setType
in interface javax.sql.RowSet
setType
in class BaseRowSet
type
- one of the following constants:
ResultSet.TYPE_FORWARD_ONLY
,
ResultSet.TYPE_SCROLL_INSENSITIVE
, or
ResultSet.TYPE_SCROLL_SENSITIVE
java.sql.SQLException
- if the parameter supplied is not one of the
following constants:
ResultSet.TYPE_FORWARD_ONLY
or
ResultSet.TYPE_SCROLL_INSENSITIVE
ResultSet.TYPE_SCROLL_SENSITIVE
BaseRowSet.getConcurrency()
,
BaseRowSet.getType()
public void setConcurrency(int concurrency) throws java.sql.SQLException
RowSet
object to
the specified concurrency. The default concurrency for any RowSet
object (connected or disconnected) is ResultSet.CONCUR_UPDATABLE
,
but this method may be called at any time to change the concurrency.
setConcurrency
in interface javax.sql.RowSet
setConcurrency
in class BaseRowSet
concurrency
- one of the following constants:
ResultSet.CONCUR_READ_ONLY
or
ResultSet.CONCUR_UPDATABLE
java.sql.SQLException
- if the parameter supplied is not one of the
following constants:
ResultSet.CONCUR_UPDATABLE
or
ResultSet.CONCUR_READ_ONLY
BaseRowSet.getConcurrency()
,
BaseRowSet.isReadOnly()
public void setTransactionIsolation(int transactionIsolation) throws java.sql.SQLException
RowSet
object to the given
constant. The DBMS will use this transaction isolation level for
transactions if it can.
For RowSet
implementations such as
the CachedRowSet
that operate in a disconnected environment,
the SyncProvider
object being used
offers complementary locking and data integrity options. The
options described below are pertinent only to connected RowSet
objects (JdbcRowSet
objects).
setTransactionIsolation
in interface javax.sql.RowSet
setTransactionIsolation
in class BaseRowSet
transactionIsolation
- one of the following constants, listed in ascending order:
Connection.TRANSACTION_NONE
,
Connection.TRANSACTION_READ_UNCOMMITTED
,
Connection.TRANSACTION_READ_COMMITTED
,
Connection.TRANSACTION_REPEATABLE_READ
, or
Connection.TRANSACTION_SERIALIZABLE
java.sql.SQLException
- if the given parameter is not one of the Connection
constantsSyncFactory
,
SyncProvider
,
BaseRowSet.getTransactionIsolation()
public void setMaxRows(int maxRows) throws java.sql.SQLException
RowSet
object may contain to
the given number. If this limit is exceeded, the excess rows are
silently dropped.
setMaxRows
in interface javax.sql.RowSet
setMaxRows
in class BaseRowSetX
maxRows
- an int
indicating the current maximum number
of rows; zero means that there is no limit
java.sql.SQLException
- if an error occurs internally setting the
maximum limit on the number of rows that a JDBC RowSet
object
can contain; or if max is less than 0
; or
if max is less than the fetchSize
of the
RowSet
public void setReadOnly(boolean isReadOnly)
RowSet
object's readOnly property to the given boolean
.
setReadOnly
in interface javax.sql.RowSet
setReadOnly
in class BaseRowSet
isReadOnly
- true
to indicate that this
RowSet
object is read-only;
false
to indicate that it is updatablepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
to the listener list.
The listener is registered for all bound properties.
addPropertyChangeListener
in interface CachedRowSetX
listener
- The PropertyChangeListener to be addedpublic void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface CachedRowSetX
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
from the listener list.
This removes a PropertyChangeListener
that was registered
for all bound properties.
removePropertyChangeListener
in interface CachedRowSetX
listener
- The PropertyChangeListener to be removedpublic void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface CachedRowSetX
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removedpublic void setCommand(java.lang.String command) throws java.sql.SQLException
RowSet
object's command
property to
the given String
object and clears the parameters, if any,
that were set for the previous command.
The command
property may not be needed if the RowSet
object gets its data from a source that does not support commands,
such as a spreadsheet or other tabular file.
Thus, this property is optional and may be null
.
setCommand
in interface javax.sql.RowSet
setCommand
in class BaseRowSetX
command
- a String
object containing an SQL query
that will be set as this RowSet
object's command
property; may be null
but may not be an empty string
java.sql.SQLException
- if an empty string is provided as the command valueBaseRowSet.getCommand()
public void populate(java.sql.ResultSet data) throws java.sql.SQLException
CachedRowSet
object with data from
the given ResultSet
object.
This method can be used as an alternative to the execute
method when an
application has a connection to an open ResultSet
object.
Using the method populate
can be more efficient than using
the version of the execute
method that takes no parameters
because it does not open a new connection and re-execute this
CachedRowSet
object's command. Using the populate
method is more a matter of convenience when compared to using the version
of execute
that takes a ResultSet
object.
populate
in interface CachedRowSet
data
- the ResultSet
object containing the data
to be read into this CachedRowSet
object
java.sql.SQLException
- if a null ResultSet
object is supplied
or this CachedRowSet
object cannot
retrieve the associated ResultSetMetaData
objectCachedRowSet.execute(java.sql.Connection)
,
ResultSet
,
ResultSetMetaData
public void execute(java.sql.Connection conn) throws java.sql.SQLException
CachedRowSet
object with data, using the
given connection to produce the result set from which the data will be read.
This method should close any database connections that it creates to
ensure that this CachedRowSet
object is disconnected except when
it is reading data from its data source or writing data to its data source.
The reader for this CachedRowSet
object
will use conn to establish a connection to the data source
so that it can execute the rowset's command and read data from the
the resulting ResultSet
object into this
CachedRowSet
object. This method also closes conn
after it has populated this CachedRowSet
object.
If this method is called when an implementation has already been
populated, the contents and the metadata are (re)set. Also, if this method is
called before the method acceptChanges
has been called
to commit outstanding updates, those updates are lost.
execute
in interface CachedRowSet
conn
- a standard JDBC Connection
object with valid
properties
java.sql.SQLException
- if an invalid Connection
object is supplied
or an error occurs in establishing the connection to the
data sourceCachedRowSet.populate(java.sql.ResultSet)
,
Connection
public void acceptChanges() throws SyncProviderException
CachedRowSet
object to the underlying data source.
This method calls on this CachedRowSet
object's writer
to do the work behind the scenes.
Standard CachedRowSet
implementations should use the
SyncFactory
singleton
to obtain a SyncProvider
instance providing a
RowSetWriter
object (writer). The writer will attempt
to propagate changes made in this CachedRowSet
object
back to the data source.
When the method acceptChanges
executes successfully, in
addition to writing changes to the data source, it
makes the values in the current row be the values in the original row.
Depending on the synchronization level of the SyncProvider
implementation being used, the writer will compare the original values
with those in the data source to check for conflicts. When there is a conflict,
the RIOptimisticProvider
implementation, for example, throws a
SyncProviderException
and does not write anything to the
data source.
An application may choose to catch the SyncProviderException
object and retrieve the SyncResolver
object it contains.
The SyncResolver
object lists the conflicts row by row and
sets a lock on the data source to avoid further conflicts while the
current conflicts are being resolved.
Further, for each conflict, it provides methods for examining the conflict
and setting the value that should be persisted in the data source.
After all conflicts have been resolved, an application must call the
acceptChanges
method again to write resolved values to the
data source. If all of the values in the data source are already the
values to be persisted, the method acceptChanges
does nothing.
Some provider implementations may use locks to ensure that there are no
conflicts. In such cases, it is guaranteed that the writer will succeed in
writing changes to the data source when the method acceptChanges
is called. This method may be called immediately after the methods
updateRow
, insertRow
, or deleteRow
have been called, but it is more efficient to call it only once after
all changes have been made so that only one connection needs to be
established.
Note: The acceptChanges()
method will determine if the
COMMIT_ON_ACCEPT_CHANGES
is set to true or not. If it is set
to true, all updates in the synchronization are committed to the data
source. Otherwise, the application must explicity call the
commit()
or rollback()
methods as appropriate.
acceptChanges
in interface CachedRowSet
SyncProviderException
- if the underlying
synchronization provider's writer fails to write the updates
back to the data sourceCachedRowSet.acceptChanges(java.sql.Connection)
,
RowSetWriter
,
SyncFactory
,
SyncProvider
,
SyncProviderException
,
SyncResolver
public void acceptChanges(java.sql.Connection con) throws SyncProviderException
CachedRowSet
object
using the specified Connection
object to establish a
connection to the data source.
The other version of the acceptChanges
method is not passed
a connection because it uses
the Connection
object already defined within the RowSet
object, which is the connection used for populating it initially.
This form of the method acceptChanges
is similar to the
form that takes no arguments; however, unlike the other form, this form
can be used only when the underlying data source is a JDBC data source.
The updated Connection
properties must be used by the
SyncProvider
to reset the RowSetWriter
configuration to ensure that the contents of the CachedRowSet
object are synchronized correctly.
When the method acceptChanges
executes successfully, in
addition to writing changes to the data source, it
makes the values in the current row be the values in the original row.
Depending on the synchronization level of the SyncProvider
implementation being used, the writer will compare the original values
with those in the data source to check for conflicts. When there is a conflict,
the RIOptimisticProvider
implementation, for example, throws a
SyncProviderException
and does not write anything to the
data source.
An application may choose to catch the SyncProviderException
object and retrieve the SyncResolver
object it contains.
The SyncResolver
object lists the conflicts row by row and
sets a lock on the data source to avoid further conflicts while the
current conflicts are being resolved.
Further, for each conflict, it provides methods for examining the conflict
and setting the value that should be persisted in the data source.
After all conflicts have been resolved, an application must call the
acceptChanges
method again to write resolved values to the
data source. If all of the values in the data source are already the
values to be persisted, the method acceptChanges
does nothing.
Some provider implementations may use locks to ensure that there are no
conflicts. In such cases, it is guaranteed that the writer will succeed in
writing changes to the data source when the method acceptChanges
is called. This method may be called immediately after the methods
updateRow
, insertRow
, or deleteRow
have been called, but it is more efficient to call it only once after
all changes have been made so that only one connection needs to be
established.
Note: The acceptChanges()
method will determine if the
COMMIT_ON_ACCEPT_CHANGES
is set to true or not. If it is set
to true, all updates in the synchronization are committed to the data
source. Otherwise, the application must explicity call the
commit
or rollback
methods as appropriate.
acceptChanges
in interface CachedRowSet
con
- a standard JDBC Connection
object
SyncProviderException
- if the underlying
synchronization provider's writer fails to write the updates
back to the data sourceCachedRowSet.acceptChanges()
,
RowSetWriter
,
SyncFactory
,
SyncProvider
,
SyncProviderException
,
SyncResolver
public void restoreOriginal() throws java.sql.SQLException
CachedRowSet
object to its original
value, that is, its value before the last set of changes. If there
have been no changes to the rowset or only one set of changes,
the original value is the value with which this CachedRowSet
object
was populated; otherwise, the original value is
the value it had immediately before its current value.
When this method is called, a CachedRowSet
implementation
must ensure that all updates, inserts, and deletes to the current
rowset instance are replaced by the previous values. In addition,
the cursor should be
reset to the first row and a rowSetChanged
event
should be fired to notify all registered listeners.
restoreOriginal
in interface CachedRowSet
java.sql.SQLException
- if an error occurs rolling back the current value of
this CachedRowSet
object to its previous valueRowSetListener.rowSetChanged(javax.sql.RowSetEvent)
public void release() throws java.sql.SQLException
CachedRowSet
object and sends a rowSetChanged
event to all
registered listeners. Any outstanding updates are discarded and
the rowset contains no rows after this method is called. There
are no interactions with the underlying data source, and any rowset
content, metadata, and content updates should be non-recoverable.
This CachedRowSet
object should lock until its contents and
associated updates are fully cleared, thus preventing 'dirty' reads by
other components that hold a reference to this RowSet
object.
In addition, the contents cannot be released
until all all components reading this CachedRowSet
object
have completed their reads. This CachedRowSet
object
should be returned to normal behavior after firing the
rowSetChanged
event.
The metadata, including JDBC properties and Synchronization SPI
properties, are maintained for future use. It is important that
properties such as the command
property be
relevant to the originating data source from which this CachedRowSet
object was originally established.
This method empties a rowset, as opposed to the close
method,
which marks the entire rowset as recoverable to allow the garbage collector
the rowset's Java VM resources.
release
in interface CachedRowSet
java.sql.SQLException
- if an error occurs flushing the contents of this
CachedRowSet
objectRowSetListener.rowSetChanged(javax.sql.RowSetEvent)
,
ResultSet.close()
public void undoDelete() throws java.sql.SQLException
In addition, multiple cancellations of row deletions can be made by adjusting the position of the cursor using any of the cursor position control methods such as:
CachedRowSet.absolute
CachedRowSet.first
CachedRowSet.last
undoDelete
in interface CachedRowSet
java.sql.SQLException
- if (1) the current row has not been deleted or
(2) the cursor is on the insert row, before the first row, or
after the last rowCachedRowSet.undoInsert()
,
ResultSet.cancelRowUpdates()
public void undoInsert() throws java.sql.SQLException
CachedRowSet
object if the row has been inserted, and also notifies listeners that a
row has changed. This method can be called at any time during the
lifetime of a rowset and assuming the current row is within
the exception limitations (see below), it cancels the row insertion
of the current row.
In addition, multiple cancellations of row insertions can be made by adjusting the position of the cursor using any of the cursor position control methods such as:
CachedRowSet.absolute
CachedRowSet.first
CachedRowSet.last
undoInsert
in interface CachedRowSet
java.sql.SQLException
- if (1) the current row has not been inserted or (2)
the cursor is before the first row, after the last row, or on the
insert rowCachedRowSet.undoDelete()
,
ResultSet.cancelRowUpdates()
public void undoUpdate() throws java.sql.SQLException
acceptChanges
) or population. This method may also be called
while performing updates to the insert row.
undoUpdate
undoUpdate
in interface CachedRowSet
java.sql.SQLException
- if the cursor is before the first row or after the last
row in in this CachedRowSet
objectCachedRowSet.undoDelete()
,
CachedRowSet.undoInsert()
,
ResultSet.cancelRowUpdates()
public javax.sql.RowSet createShared() throws java.sql.SQLException
RowSet
object backed by the same data as
that of this CachedRowSet
object. In effect, both
CachedRowSet
objects have a cursor over the same data.
As a result, any changes made by a duplicate are visible to the original
and to any other duplicates, just as a change made by the original is visible
to all of its duplicates. If a duplicate calls a method that changes the
underlying data, the method it calls notifies all registered listeners
just as it would when it is called by the original CachedRowSet
object.
In addition, any RowSet
object
created by this method will have the same properties as this
CachedRowSet
object. For example, if this CachedRowSet
object is read-only, all of its duplicates will also be read-only. If it is
changed to be updatable, the duplicates also become updatable.
NOTE: If multiple threads access RowSet
objects created from
the createShared()
method, the following behavior is specified
to preserve shared data integrity: reads and writes of all
shared RowSet
objects should be made serially between each
object and the single underlying tabular structure.
createShared
in interface CachedRowSet
RowSet
object that has the same properties
as this CachedRowSet
object and that has a cursor over
the same data
java.sql.SQLException
- if an error occurs or cloning is not
supported in the underlying platformRowSetEvent
,
RowSetListener
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
RowSet
object containing by the same data
as this CachedRowSetXImpl
object. This method
differs from the method createCopy
in that it throws a
CloneNotSupportedException
object instead of an
SQLException
object, as the method createShared
does. This clone
method is called internally by the method createShared
,
which catches the CloneNotSupportedException
object
and in turn throws a new SQLException
object.
CachedRowSetXImpl
object
java.lang.CloneNotSupportedException
- if an error occurs when
attempting to clone this CachedRowSetXImpl
objectcreateShared()
public CachedRowSet createCopy() throws java.sql.SQLException
RowSet
object that is a deep copy of
a CachedRowSet
object instance data. In contrast to
the RowSet
generated from a createShared
call, updates made to the copy of the original RowSet
must not be visible to original RowSet
. Equally any
event listeners that are registered with the original
RowSet
must not have scope over the new
RowSet
copies. In addition any constraint restrictions
established must be maintained.
createCopy
in interface CachedRowSet
CachedRowSet
object that is a deep copy
of the CachedRowSet
object instance and is
completely independent of its originating
CachedRowSet
java.sql.SQLException
- if an error occurs in generating the copy of
the of the CachedRowSet
CachedRowSet.createShared()
,
CachedRowSet.createCopySchema()
,
CachedRowSet.createCopyNoConstraints()
,
RowSetEvent
,
RowSetListener
public CachedRowSet createCopySchema() throws java.sql.SQLException
CachedRowSet
object
instance. Any copies
must not contain any contents but only represent the table
structure of the original RowSet. In addition, primary or foreign
key constraints set in the originating RowSet
must
equally enforced in the new empty CachedRowSet
.
In contrast to
the RowSet
generated from a createShared
call, updates made to the copy of the original RowSet
must not be visible to original RowSet
.
Applications can form a WebRowSet
object instance
to export the RowSet schema definition to XML for future use.
createCopySchema
in interface CachedRowSet
java.sql.SQLException
- if an error occurs when cloning the
originating CachedRowSet
structureCachedRowSet.createShared()
,
CachedRowSet.createCopySchema()
,
CachedRowSet.createCopyNoConstraints()
,
RowSetEvent
,
RowSetListener
public CachedRowSet createCopyNoConstraints() throws java.sql.SQLException
RowSet
object that is a deep copy of
a CachedRowSet
object instance data. In contrast to
the RowSet
generated from a createShared
call, updates made to the copy of the original RowSet
must not be visible to original RowSet
. Equally any
event listeners that are registered with the original
RowSet
must not have scope over the new
RowSet
copies. In addition any constraint restrictions
established must not be maintained.
createCopyNoConstraints
in interface CachedRowSet
CachedRowSet
object that is a deep copy
of the CachedRowSet
object instance and is
completely independent of its originating
CachedRowSet
java.sql.SQLException
- if an error occurs in generating the copy of
the of the CachedRowSet
CachedRowSet.createCopy()
,
CachedRowSet.createShared()
,
CachedRowSet.createCopySchema()
,
RowSetEvent
,
RowSetListener
public java.util.Collection toCollection() throws java.sql.SQLException
CachedRowSet
object to a Collection
object that contains all of the CachedRowSet
object's values.
Implementations have some latitude in
how they can represent this Collection
object because of the
abstract nature of the Collection
framework.
Each row must be fully represented in either a
general purpose Collection
implementation or a specialized
Collection
implementation, such as a TreeMap
object or a Vector
object.
An SQL NULL
column value must be represented as a null
in the Java programming language.
The standard reference implementation for the CachedRowSet
interface uses a TreeMap
object for the rowset, with the
values in each row being contained in Vector
objects. It is
expected that most implementations will do the same.
The TreeMap
type of collection guarantees that the map will be in
ascending key order, sorted according to the natural order for the
key's class.
Each key references a Vector
object that corresponds to one
row of a RowSet
object. Therefore, the size of each
Vector
object must be exactly equal to the number of
columns in the RowSet
object.
The key used by the TreeMap
collection is determined by the
implementation, which may choose to leverage a set key that is
available within the internal RowSet
tabular structure by
virtue of a key already set either on the RowSet
object
itself or on the underlying SQL data.
toCollection
in interface CachedRowSet
Collection
object that contains the values in
each row in this CachedRowSet
object
java.sql.SQLException
- if an error occurs generating the collectionCachedRowSet.toCollection(int)
,
CachedRowSet.toCollection(String)
public java.util.Collection toCollection(int column) throws java.sql.SQLException
CachedRowSet
object
to a Collection
object. Implementations have some latitude in
how they can represent this Collection
object because of the
abstract nature of the Collection
framework.
Each column value should be fully represented in either a
general purpose Collection
implementation or a specialized
Collection
implementation, such as a Vector
object.
An SQL NULL
column value must be represented as a null
in the Java programming language.
The standard reference implementation uses a Vector
object
to contain the column values, and it is expected
that most implementations will do the same. If a Vector
object
is used, it size must be exactly equal to the number of rows
in this CachedRowSet
object.
toCollection
in interface CachedRowSet
column
- an int
indicating the column whose values
are to be represented in a Collection
object
Collection
object that contains the values
stored in the specified column of this CachedRowSet
object
java.sql.SQLException
- if an error occurs generating the collection or
an invalid column id is providedCachedRowSet.toCollection()
,
CachedRowSet.toCollection(String)
public java.util.Collection toCollection(java.lang.String column) throws java.sql.SQLException
CachedRowSet
object
to a Collection
object. Implementations have some latitude in
how they can represent this Collection
object because of the
abstract nature of the Collection
framework.
Each column value should be fully represented in either a
general purpose Collection
implementation or a specialized
Collection
implementation, such as a Vector
object.
An SQL NULL
column value must be represented as a null
in the Java programming language.
The standard reference implementation uses a Vector
object
to contain the column values, and it is expected
that most implementations will do the same. If a Vector
object
is used, it size must be exactly equal to the number of rows
in this CachedRowSet
object.
toCollection
in interface CachedRowSet
column
- a String
object giving the name of the
column whose values are to be represented in a collection
Collection
object that contains the values
stored in the specified column of this CachedRowSet
object
java.sql.SQLException
- if an error occurs generating the collection or
an invalid column id is providedCachedRowSet.toCollection()
,
CachedRowSet.toCollection(int)
public SyncProvider getSyncProvider() throws java.sql.SQLException
SyncProvider
implementation for this
CachedRowSet
object. Internally, this method is used by a rowset
to trigger read or write actions between the rowset
and the data source. For example, a rowset may need to get a handle
on the the rowset reader (RowSetReader
object) from the
SyncProvider
to allow the rowset to be populated.
RowSetReader rowsetReader = null; SyncProvider provider = SyncFactory.getInstance("javax.sql.rowset.provider.RIOptimisticProvider"); if (provider instanceof RIOptimisticProvider) { rowsetReader = provider.getRowSetReader(); }Assuming rowsetReader is a private, accessible field within the rowset implementation, when an application calls the
execute
method, it in turn calls on the reader's readData
method
to populate the RowSet
object.
rowsetReader.readData((RowSetInternal)this);
In addition, an application can use the SyncProvider
object
returned by this method to call methods that return information about the
SyncProvider
object, including information about the
vendor, version, provider identification, synchronization grade, and locks
it currently has set.
getSyncProvider
in interface CachedRowSet
SyncProvider
object that was set when the rowset
was instantiated, or if none was was set, the default provider
java.sql.SQLException
- if an error occurs while returning the
SyncProvider
objectCachedRowSet.setSyncProvider(java.lang.String)
public void setSyncProvider(java.lang.String providerStr) throws java.sql.SQLException
SyncProvider
objec for this CachedRowSet
object to the one specified. This method
allows the SyncProvider
object to be reset.
A CachedRowSet
implementation should always be instantiated
with an available SyncProvider
mechanism, but there are
cases where resetting the SyncProvider
object is desirable
or necessary. For example, an application might want to use the default
SyncProvider
object for a time and then choose to use a provider
that has more recently become available and better fits its needs.
Resetting the SyncProvider
object causes the
RowSet
object to request a new SyncProvider
implementation
from the SyncFactory
. This has the effect of resetting
all previous connections and relationships with the originating
data source and can potentially drastically change the synchronization
behavior of a disconnected rowset.
setSyncProvider
in interface CachedRowSet
providerStr
- a String
object giving the fully qualified class
name of a SyncProvider
implementation
java.sql.SQLException
- if an error occurs while attempting to reset the
SyncProvider
implementationCachedRowSet.getSyncProvider()
public void execute() throws java.sql.SQLException
execute
in interface javax.sql.RowSet
java.sql.SQLException
public boolean next() throws java.sql.SQLException
next
in interface java.sql.ResultSet
java.sql.SQLException
protected boolean internalNext() throws java.sql.SQLException
CachedRowSetXImpl
object's cursor to the next
row and returns true
if the cursor is still in the rowset;
returns false
if the cursor has moved to the position after
the last row.
This method handles the cases where the cursor moves to a row that has been deleted. If this rowset shows deleted rows and the cursor moves to a row that has been deleted, this method moves the cursor to the next row until the cursor is on a row that has not been deleted.
The method internalNext
is called by methods such as
next
, absolute
, and relative
,
and, as its name implies, is only called internally.
This is a implementation only method and is not required as a standard
implementation of the CachedRowSet
interface.
true
if the cursor is on a valid row in this
rowset; false
if it is after the last row
java.sql.SQLException
- if an error occurspublic void close()
close
in interface java.sql.ResultSet
public boolean wasNull() throws java.sql.SQLException
wasNull
in interface java.sql.ResultSet
java.sql.SQLException
protected BaseRow getCurrentRow() throws java.sql.SQLException
CachedRowSetXImpl
object.
Row
object on which this CachedRowSetXImpl
objects's cursor is positioned
java.sql.SQLException
protected void removeCurrentRow() throws java.sql.SQLException
This is a implementation only method and is not required as a standard
implementation of the CachedRowSet
interface.
java.sql.SQLException
- if the cursor is positioned on the insert
rowpublic java.lang.String getString(int columnIndex) throws java.sql.SQLException
getString
in interface java.sql.ResultSet
java.sql.SQLException
public boolean getBoolean(int columnIndex) throws java.sql.SQLException
getBoolean
in interface java.sql.ResultSet
java.sql.SQLException
public byte getByte(int columnIndex) throws java.sql.SQLException
getByte
in interface java.sql.ResultSet
java.sql.SQLException
public short getShort(int columnIndex) throws java.sql.SQLException
getShort
in interface java.sql.ResultSet
java.sql.SQLException
public int getInt(int columnIndex) throws java.sql.SQLException
getInt
in interface java.sql.ResultSet
java.sql.SQLException
public long getLong(int columnIndex) throws java.sql.SQLException
getLong
in interface java.sql.ResultSet
java.sql.SQLException
public float getFloat(int columnIndex) throws java.sql.SQLException
getFloat
in interface java.sql.ResultSet
java.sql.SQLException
public double getDouble(int columnIndex) throws java.sql.SQLException
getDouble
in interface java.sql.ResultSet
java.sql.SQLException
public java.math.BigDecimal getBigDecimal(int columnIndex, int scale) throws java.sql.SQLException
getBigDecimal
in interface java.sql.ResultSet
java.sql.SQLException
public byte[] getBytes(int columnIndex) throws java.sql.SQLException
getBytes
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Date getDate(int columnIndex) throws java.sql.SQLException
getDate
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Time getTime(int columnIndex) throws java.sql.SQLException
getTime
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Timestamp getTimestamp(int columnIndex) throws java.sql.SQLException
getTimestamp
in interface java.sql.ResultSet
java.sql.SQLException
public java.io.InputStream getAsciiStream(int columnIndex) throws java.sql.SQLException
getAsciiStream
in interface java.sql.ResultSet
java.sql.SQLException
public java.io.InputStream getUnicodeStream(int columnIndex) throws java.sql.SQLException
getUnicodeStream
in interface java.sql.ResultSet
java.sql.SQLException
public java.io.InputStream getBinaryStream(int columnIndex) throws java.sql.SQLException
getBinaryStream
in interface java.sql.ResultSet
java.sql.SQLException
public java.lang.String getString(java.lang.String columnName) throws java.sql.SQLException
getString
in interface java.sql.ResultSet
java.sql.SQLException
public boolean getBoolean(java.lang.String columnName) throws java.sql.SQLException
getBoolean
in interface java.sql.ResultSet
java.sql.SQLException
public byte getByte(java.lang.String columnName) throws java.sql.SQLException
getByte
in interface java.sql.ResultSet
java.sql.SQLException
public short getShort(java.lang.String columnName) throws java.sql.SQLException
getShort
in interface java.sql.ResultSet
java.sql.SQLException
public int getInt(java.lang.String columnName) throws java.sql.SQLException
getInt
in interface java.sql.ResultSet
java.sql.SQLException
public long getLong(java.lang.String columnName) throws java.sql.SQLException
getLong
in interface java.sql.ResultSet
java.sql.SQLException
public float getFloat(java.lang.String columnName) throws java.sql.SQLException
getFloat
in interface java.sql.ResultSet
java.sql.SQLException
public double getDouble(java.lang.String columnName) throws java.sql.SQLException
getDouble
in interface java.sql.ResultSet
java.sql.SQLException
public java.math.BigDecimal getBigDecimal(java.lang.String columnName, int scale) throws java.sql.SQLException
getBigDecimal
in interface java.sql.ResultSet
java.sql.SQLException
public byte[] getBytes(java.lang.String columnName) throws java.sql.SQLException
getBytes
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Date getDate(java.lang.String columnName) throws java.sql.SQLException
getDate
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Time getTime(java.lang.String columnName) throws java.sql.SQLException
getTime
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Timestamp getTimestamp(java.lang.String columnName) throws java.sql.SQLException
getTimestamp
in interface java.sql.ResultSet
java.sql.SQLException
public java.io.InputStream getAsciiStream(java.lang.String columnName) throws java.sql.SQLException
getAsciiStream
in interface java.sql.ResultSet
java.sql.SQLException
public java.io.InputStream getUnicodeStream(java.lang.String columnName) throws java.sql.SQLException
getUnicodeStream
in interface java.sql.ResultSet
java.sql.SQLException
public java.io.InputStream getBinaryStream(java.lang.String columnName) throws java.sql.SQLException
getBinaryStream
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.SQLWarning getWarnings()
getWarnings
in interface java.sql.ResultSet
public void clearWarnings()
clearWarnings
in interface java.sql.ResultSet
public java.lang.String getCursorName() throws java.sql.SQLException
getCursorName
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.ResultSet
java.sql.SQLException
public java.lang.Object getObject(int columnIndex) throws java.sql.SQLException
getObject
in interface java.sql.ResultSet
java.sql.SQLException
public java.lang.Object getObject(java.lang.String columnName) throws java.sql.SQLException
getObject
in interface java.sql.ResultSet
java.sql.SQLException
public int findColumn(java.lang.String columnName) throws java.sql.SQLException
findColumn
in interface java.sql.ResultSet
java.sql.SQLException
public java.io.Reader getCharacterStream(int columnIndex) throws java.sql.SQLException
getCharacterStream
in interface java.sql.ResultSet
java.sql.SQLException
public java.io.Reader getCharacterStream(java.lang.String columnName) throws java.sql.SQLException
getCharacterStream
in interface java.sql.ResultSet
java.sql.SQLException
public java.math.BigDecimal getBigDecimal(int columnIndex) throws java.sql.SQLException
getBigDecimal
in interface java.sql.ResultSet
java.sql.SQLException
public java.math.BigDecimal getBigDecimal(java.lang.String columnName) throws java.sql.SQLException
getBigDecimal
in interface java.sql.ResultSet
java.sql.SQLException
public int size()
CachedRowSet
object.
size
in interface CachedRowSet
public boolean isBeforeFirst() throws java.sql.SQLException
isBeforeFirst
in interface java.sql.ResultSet
java.sql.SQLException
public boolean isAfterLast() throws java.sql.SQLException
isAfterLast
in interface java.sql.ResultSet
java.sql.SQLException
public boolean isFirst() throws java.sql.SQLException
isFirst
in interface java.sql.ResultSet
java.sql.SQLException
public boolean isLast() throws java.sql.SQLException
isLast
in interface java.sql.ResultSet
java.sql.SQLException
public void beforeFirst() throws java.sql.SQLException
beforeFirst
in interface java.sql.ResultSet
java.sql.SQLException
public void afterLast() throws java.sql.SQLException
afterLast
in interface java.sql.ResultSet
java.sql.SQLException
public boolean first() throws java.sql.SQLException
first
in interface java.sql.ResultSet
java.sql.SQLException
protected boolean internalFirst() throws java.sql.SQLException
java.sql.SQLException
public boolean last() throws java.sql.SQLException
last
in interface java.sql.ResultSet
java.sql.SQLException
protected boolean internalLast() throws java.sql.SQLException
java.sql.SQLException
public int getRow() throws java.sql.SQLException
getRow
in interface java.sql.ResultSet
java.sql.SQLException
public boolean absolute(int row) throws java.sql.SQLException
absolute
in interface java.sql.ResultSet
java.sql.SQLException
public boolean relative(int rows) throws java.sql.SQLException
relative
in interface java.sql.ResultSet
java.sql.SQLException
public boolean previous() throws java.sql.SQLException
previous
in interface java.sql.ResultSet
java.sql.SQLException
protected boolean internalPrevious() throws java.sql.SQLException
java.sql.SQLException
public boolean rowUpdated() throws java.sql.SQLException
rowUpdated
in interface java.sql.ResultSet
java.sql.SQLException
public boolean columnUpdated(int idx) throws java.sql.SQLException
CachedRowSet
object has been updated.
columnUpdated
in interface CachedRowSet
idx
- an int
identifying the column to be checked for updates
true
if the designated column has been visibly updated;
false
otherwise
java.sql.SQLException
- if the cursor is on the insert row, before the first row,
or after the last rowDatabaseMetaData.updatesAreDetected(int)
public boolean columnUpdated(java.lang.String columnName) throws java.sql.SQLException
CachedRowSet
object has been updated.
columnUpdated
in interface CachedRowSet
columnName
- a String
object giving the name of the
column to be checked for updates
true
if the column has been visibly updated;
false
otherwise
java.sql.SQLException
- if the cursor is on the insert row, before the first row,
or after the last rowDatabaseMetaData.updatesAreDetected(int)
public boolean rowInserted() throws java.sql.SQLException
rowInserted
in interface java.sql.ResultSet
java.sql.SQLException
public boolean rowDeleted() throws java.sql.SQLException
rowDeleted
in interface java.sql.ResultSet
java.sql.SQLException
public void updateNull(int columnIndex) throws java.sql.SQLException
updateNull
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBoolean(int columnIndex, boolean x) throws java.sql.SQLException
updateBoolean
in interface java.sql.ResultSet
java.sql.SQLException
public void updateByte(int columnIndex, byte x) throws java.sql.SQLException
updateByte
in interface java.sql.ResultSet
java.sql.SQLException
public void updateShort(int columnIndex, short x) throws java.sql.SQLException
updateShort
in interface java.sql.ResultSet
java.sql.SQLException
public void updateInt(int columnIndex, int x) throws java.sql.SQLException
updateInt
in interface java.sql.ResultSet
java.sql.SQLException
public void updateLong(int columnIndex, long x) throws java.sql.SQLException
updateLong
in interface java.sql.ResultSet
java.sql.SQLException
public void updateFloat(int columnIndex, float x) throws java.sql.SQLException
updateFloat
in interface java.sql.ResultSet
java.sql.SQLException
public void updateDouble(int columnIndex, double x) throws java.sql.SQLException
updateDouble
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBigDecimal(int columnIndex, java.math.BigDecimal x) throws java.sql.SQLException
updateBigDecimal
in interface java.sql.ResultSet
java.sql.SQLException
public void updateString(int columnIndex, java.lang.String x) throws java.sql.SQLException
updateString
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBytes(int columnIndex, byte[] x) throws java.sql.SQLException
updateBytes
in interface java.sql.ResultSet
java.sql.SQLException
public void updateDate(int columnIndex, java.sql.Date x) throws java.sql.SQLException
updateDate
in interface java.sql.ResultSet
java.sql.SQLException
public void updateTime(int columnIndex, java.sql.Time x) throws java.sql.SQLException
updateTime
in interface java.sql.ResultSet
java.sql.SQLException
public void updateTimestamp(int columnIndex, java.sql.Timestamp x) throws java.sql.SQLException
updateTimestamp
in interface java.sql.ResultSet
java.sql.SQLException
public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws java.sql.SQLException
updateAsciiStream
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBinaryStream(int columnIndex, java.io.InputStream x, int length) throws java.sql.SQLException
updateBinaryStream
in interface java.sql.ResultSet
java.sql.SQLException
public void updateCharacterStream(int columnIndex, java.io.Reader x, int length) throws java.sql.SQLException
updateCharacterStream
in interface java.sql.ResultSet
java.sql.SQLException
public void updateObject(int columnIndex, java.lang.Object x, int scale) throws java.sql.SQLException
updateObject
in interface java.sql.ResultSet
java.sql.SQLException
public void updateObject(int columnIndex, java.lang.Object x) throws java.sql.SQLException
updateObject
in interface java.sql.ResultSet
java.sql.SQLException
public void updateNull(java.lang.String columnName) throws java.sql.SQLException
updateNull
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBoolean(java.lang.String columnName, boolean x) throws java.sql.SQLException
updateBoolean
in interface java.sql.ResultSet
java.sql.SQLException
public void updateByte(java.lang.String columnName, byte x) throws java.sql.SQLException
updateByte
in interface java.sql.ResultSet
java.sql.SQLException
public void updateShort(java.lang.String columnName, short x) throws java.sql.SQLException
updateShort
in interface java.sql.ResultSet
java.sql.SQLException
public void updateInt(java.lang.String columnName, int x) throws java.sql.SQLException
updateInt
in interface java.sql.ResultSet
java.sql.SQLException
public void updateLong(java.lang.String columnName, long x) throws java.sql.SQLException
updateLong
in interface java.sql.ResultSet
java.sql.SQLException
public void updateFloat(java.lang.String columnName, float x) throws java.sql.SQLException
updateFloat
in interface java.sql.ResultSet
java.sql.SQLException
public void updateDouble(java.lang.String columnName, double x) throws java.sql.SQLException
updateDouble
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBigDecimal(java.lang.String columnName, java.math.BigDecimal x) throws java.sql.SQLException
updateBigDecimal
in interface java.sql.ResultSet
java.sql.SQLException
public void updateString(java.lang.String columnName, java.lang.String x) throws java.sql.SQLException
updateString
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBytes(java.lang.String columnName, byte[] x) throws java.sql.SQLException
updateBytes
in interface java.sql.ResultSet
java.sql.SQLException
public void updateDate(java.lang.String columnName, java.sql.Date x) throws java.sql.SQLException
updateDate
in interface java.sql.ResultSet
java.sql.SQLException
public void updateTime(java.lang.String columnName, java.sql.Time x) throws java.sql.SQLException
updateTime
in interface java.sql.ResultSet
java.sql.SQLException
public void updateTimestamp(java.lang.String columnName, java.sql.Timestamp x) throws java.sql.SQLException
updateTimestamp
in interface java.sql.ResultSet
java.sql.SQLException
public void updateAsciiStream(java.lang.String columnName, java.io.InputStream x, int length) throws java.sql.SQLException
updateAsciiStream
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBinaryStream(java.lang.String columnName, java.io.InputStream x, int length) throws java.sql.SQLException
updateBinaryStream
in interface java.sql.ResultSet
java.sql.SQLException
public void updateCharacterStream(java.lang.String columnName, java.io.Reader reader, int length) throws java.sql.SQLException
updateCharacterStream
in interface java.sql.ResultSet
java.sql.SQLException
public void updateObject(java.lang.String columnName, java.lang.Object x, int scale) throws java.sql.SQLException
updateObject
in interface java.sql.ResultSet
java.sql.SQLException
public void updateObject(java.lang.String columnName, java.lang.Object x) throws java.sql.SQLException
updateObject
in interface java.sql.ResultSet
java.sql.SQLException
public void insertRow() throws java.sql.SQLException
insertRow
in interface java.sql.ResultSet
java.sql.SQLException
public void updateRow() throws java.sql.SQLException
updateRow
in interface java.sql.ResultSet
java.sql.SQLException
public void deleteRow() throws java.sql.SQLException
deleteRow
in interface java.sql.ResultSet
java.sql.SQLException
public void refreshRow() throws java.sql.SQLException
refreshRow
in interface java.sql.ResultSet
java.sql.SQLException
public void cancelRowUpdates() throws java.sql.SQLException
cancelRowUpdates
in interface java.sql.ResultSet
java.sql.SQLException
public void moveToInsertRow() throws java.sql.SQLException
moveToInsertRow
in interface java.sql.ResultSet
java.sql.SQLException
public void moveToCurrentRow() throws java.sql.SQLException
moveToCurrentRow
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Statement getStatement() throws java.sql.SQLException
null
.
getStatement
in interface java.sql.ResultSet
null
java.sql.SQLException
- if an error occurspublic java.lang.Object getObject(int columnIndex, java.util.Map map) throws java.sql.SQLException
getObject
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Ref getRef(int columnIndex) throws java.sql.SQLException
getRef
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Blob getBlob(int columnIndex) throws java.sql.SQLException
getBlob
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Clob getClob(int columnIndex) throws java.sql.SQLException
getClob
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Array getArray(int columnIndex) throws java.sql.SQLException
getArray
in interface java.sql.ResultSet
java.sql.SQLException
public java.lang.Object getObject(java.lang.String columnName, java.util.Map map) throws java.sql.SQLException
getObject
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Ref getRef(java.lang.String colName) throws java.sql.SQLException
getRef
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Blob getBlob(java.lang.String colName) throws java.sql.SQLException
getBlob
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Clob getClob(java.lang.String colName) throws java.sql.SQLException
getClob
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Array getArray(java.lang.String colName) throws java.sql.SQLException
getArray
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Date getDate(int columnIndex, java.util.Calendar cal) throws java.sql.SQLException
getDate
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Date getDate(java.lang.String columnName, java.util.Calendar cal) throws java.sql.SQLException
getDate
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Time getTime(int columnIndex, java.util.Calendar cal) throws java.sql.SQLException
getTime
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Time getTime(java.lang.String columnName, java.util.Calendar cal) throws java.sql.SQLException
getTime
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Timestamp getTimestamp(int columnIndex, java.util.Calendar cal) throws java.sql.SQLException
getTimestamp
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Timestamp getTimestamp(java.lang.String columnName, java.util.Calendar cal) throws java.sql.SQLException
getTimestamp
in interface java.sql.ResultSet
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
Connection
object passed to this
CachedRowSetXImpl
object. This connection may be
used to populate this rowset with data or to write data back
to its underlying data source.
getConnection
in interface javax.sql.RowSetInternal
Connection
object passed to this rowset;
may be null
if there is no connection
java.sql.SQLException
- if an error occurspublic void setMetaData(javax.sql.RowSetMetaData md) throws java.sql.SQLException
CachedRowSet
CachedRowSet
object with
the given RowSetMetaData
object. When a
RowSetReader
object is reading the contents of a rowset,
it creates a RowSetMetaData
object and initializes
it using the methods in the RowSetMetaData
implementation.
The reference implementation uses the RowSetMetaDataImpl
class. When the reader has completed reading the rowset contents,
this method is called internally to pass the RowSetMetaData
object to the rowset.
setMetaData
in interface CachedRowSet
md
- a RowSetMetaData
object containing
metadata about the columns in this CachedRowSet
object
java.sql.SQLException
- if invalid metadata is supplied to the
rowsetpublic java.sql.ResultSet getOriginal() throws java.sql.SQLException
CachedRowSet
ResultSet
object containing the original value of this
CachedRowSet
object.
The cursor for the ResultSet
object should be positioned before the first row.
In addition, the returned ResultSet
object should have the following
properties:
The original value for a RowSet
object is the value it had before
the last synchronization with the underlying data source. If there have been
no synchronizations, the original value will be the value with which the
RowSet
object was populated. This method is called internally
when an aplication calls the method acceptChanges
and the
SyncProvider
object has been implemented to check for conflicts.
If this is the case, the writer compares the original value with the value
currently in the data source to check for conflicts.
getOriginal
in interface CachedRowSet
ResultSet
object that contains the original value for
this CachedRowSet
object
java.sql.SQLException
- if an error occurs producing the
ResultSet
objectpublic java.sql.ResultSet getOriginalRow() throws java.sql.SQLException
CachedRowSet
ResultSet
object containing the original value for the
current row only of this CachedRowSet
object.
The cursor for the ResultSet
object should be positioned before the first row.
In addition, the returned ResultSet
object should have the following
properties:
getOriginalRow
in interface CachedRowSet
java.sql.SQLException
- if there is no current rowCachedRowSet.setOriginalRow()
public void setOriginalRow() throws java.sql.SQLException
CachedRowSet
CachedRowSet
object as the original
row.
This method is called internally after the any modified values in the current row have been synchronized with the data source. The current row must be tagged as no longer inserted, deleted or updated.
A call to setOriginalRow
is irreversible.
setOriginalRow
in interface CachedRowSet
java.sql.SQLException
- if there is no current row or an error is
encountered resetting the contents of the original rowCachedRowSet.getOriginalRow()
public void setOriginal() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getTableName() throws java.sql.SQLException
CachedRowSet
CachedRowSet
object. This name may be set on multiple occasions,
and the specification imposes no limits on how many times this
may occur or whether standard implementations should keep track
of previous table names.
getTableName
in interface CachedRowSet
String
object giving the name of the table that is the
source of data for this CachedRowSet
object or null
if no name has been set for the table
java.sql.SQLException
- if an error is encountered returning the table nameResultSetMetaData.getTableName(int)
public void setTableName(java.lang.String tabName) throws java.sql.SQLException
CachedRowSet
CachedRowSet
object was derived to the given table name. The writer uses this name to
determine which table to use when comparing the values in the data source with the
CachedRowSet
object's values during a synchronization attempt.
The table identifier also indicates where modified values from this
CachedRowSet
object should be written.
The implementation of this CachedRowSet
object may obtain the
the name internally from the RowSetMetaDataImpl
object.
setTableName
in interface CachedRowSet
tabName
- a String
object identifying the table from which this
CachedRowSet
object was derived; cannot be null
but may be an empty string
java.sql.SQLException
- if an error is encountered naming the table or
tabName is null
RowSetMetaData.setTableName(int, java.lang.String)
,
RowSetWriter
,
SyncProvider
public int[] getKeyColumns() throws java.sql.SQLException
CachedRowSet
CachedRowSet
object.
getKeyColumns
in interface CachedRowSet
CachedRowSet
object. This array should be
empty if no columns are representative of a primary key.
java.sql.SQLException
- if this CachedRowSet
object is emptyCachedRowSet.setKeyColumns(int[])
,
Joinable.getMatchColumnIndexes()
,
Joinable.getMatchColumnNames()
public void setKeyColumns(int[] keys) throws java.sql.SQLException
CachedRowSet
CachedRowSet
object's keyCols
field with the given array of column numbers, which forms a key
for uniquely identifying a row in this rowset.
If a CachedRowSet
object becomes part of a JoinRowSet
object, the keys defined by this method and the resulting constraints are
maintained if the columns designated as key columns also become match
columns.
setKeyColumns
in interface CachedRowSet
keys
- an array of int
indicating the columns that form
a primary key for this CachedRowSet
object; every
element in the array must be greater than 0
and
less than or equal to the number of columns in this rowset
java.sql.SQLException
- if any of the numbers in the given array
are not valid for this rowsetCachedRowSet.getKeyColumns()
,
Joinable.setMatchColumn(String)
,
Joinable.setMatchColumn(int)
public void updateRef(int columnIndex, java.sql.Ref ref) throws java.sql.SQLException
updateRef
in interface java.sql.ResultSet
java.sql.SQLException
public void updateRef(java.lang.String columnName, java.sql.Ref ref) throws java.sql.SQLException
updateRef
in interface java.sql.ResultSet
java.sql.SQLException
public void updateClob(int columnIndex, java.sql.Clob c) throws java.sql.SQLException
updateClob
in interface java.sql.ResultSet
java.sql.SQLException
public void updateClob(java.lang.String columnName, java.sql.Clob c) throws java.sql.SQLException
updateClob
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBlob(int columnIndex, java.sql.Blob b) throws java.sql.SQLException
updateBlob
in interface java.sql.ResultSet
java.sql.SQLException
public void updateBlob(java.lang.String columnName, java.sql.Blob b) throws java.sql.SQLException
updateBlob
in interface java.sql.ResultSet
java.sql.SQLException
public void updateArray(int columnIndex, java.sql.Array a) throws java.sql.SQLException
updateArray
in interface java.sql.ResultSet
java.sql.SQLException
public void updateArray(java.lang.String columnName, java.sql.Array a) throws java.sql.SQLException
updateArray
in interface java.sql.ResultSet
java.sql.SQLException
public java.net.URL getURL(int columnIndex) throws java.sql.SQLException
getURL
in interface java.sql.ResultSet
java.sql.SQLException
public java.net.URL getURL(java.lang.String columnName) throws java.sql.SQLException
getURL
in interface java.sql.ResultSet
java.sql.SQLException
public RowSetWarning getRowSetWarnings()
CachedRowSet
RowSet
object.
Subsequent warnings on this RowSet
object will be chained to the
RowSetWarning
object that this method returns.
The warning chain is automatically cleared each time a new row is read.
This method may not be called on a RowSet object that has been closed;
doing so will cause a SQLException
to be thrown.
getRowSetWarnings
in interface CachedRowSet
RowSetWarning
object reported or null if there are noneRowSetWarning
public void commit() throws java.sql.SQLException
CachedRowSet
CachedRowSet
object's SyncProvider
contains
a Connection
object from the ResultSet
or JDBC
properties passed to it's constructors. This method wraps the
Connection
commit method to allow flexible
auto commit or non auto commit transactional control support.
Makes all changes that are performed by the acceptChanges()
method since the previous commit/rollback permanent. This method should
be used only when auto-commit mode has been disabled.
commit
in interface CachedRowSet
java.sql.SQLException
- if a database access error occurs or this
Connection object within this CachedRowSet
is in auto-commit modeConnection.setAutoCommit(boolean)
public void rollback() throws java.sql.SQLException
CachedRowSet
CachedRowSet
object's SyncProvider
contains
a Connection
object from the original ResultSet
or JDBC properties passed to it.
Undoes all changes made in the current transaction. This method should be used only when auto-commit mode has been disabled.
rollback
in interface CachedRowSet
java.sql.SQLException
- if a database access error occurs or this Connection
object within this CachedRowSet
is in auto-commit mode.public void rollback(java.sql.Savepoint s) throws java.sql.SQLException
CachedRowSet
CachedRowSet
object's SyncProvider
contains
a Connection
object from the original ResultSet
or JDBC properties passed to it.
Undoes all changes made in the current transaction back to the last
Savepoint
transaction marker. This method should be used only
when auto-commit mode has been disabled.
rollback
in interface CachedRowSet
s
- A Savepoint
transaction marker
java.sql.SQLException
- if a database access error occurs or this Connection
object within this CachedRowSet
is in auto-commit mode.public void unsetMatchColumn(int[] columnIdxes) throws java.sql.SQLException
Joinable
RowSet
object.
unsetMatchColumn
in interface Joinable
columnIdxes
- an arrary of int
that identifies the indexes
of the column that are to be unset as a match column
java.sql.SQLException
- if an invalid column index is designated or if
the designated column was not previously set as a match
columnJoinable.setMatchColumn(int)
public void unsetMatchColumn(java.lang.String[] columnIdxes) throws java.sql.SQLException
Joinable
RowSet
object.
unsetMatchColumn
in interface Joinable
columnIdxes
- a array String
objects giving the name of
the columns that are to be unset as a match columns
java.sql.SQLException
- if an invalid column name is designated or the
designated column was not previously set as a match columnJoinable.setMatchColumn(int)
public java.lang.String[] getMatchColumnNames() throws java.sql.SQLException
Joinable
RowSet
object with the method
setMatchColumn(String columnName)
.
getMatchColumnNames
in interface Joinable
String
object giving the name of the column
set as the match column for this RowSet
object
java.sql.SQLException
- if no match column has been setJoinable.setMatchColumn(int)
,
Joinable.unsetMatchColumn(int)
public int[] getMatchColumnIndexes() throws java.sql.SQLException
Joinable
RowSet
object with the method
setMatchColumn(int columnIdx)
.
getMatchColumnIndexes
in interface Joinable
int
identifying the index of the column that was set
as the match column for this RowSet
object
java.sql.SQLException
- if no match column has been setJoinable.setMatchColumn(int)
,
Joinable.unsetMatchColumn(int)
public void setMatchColumn(int[] columnIdxes) throws java.sql.SQLException
Joinable
RowSet
object. A JoinRowSet
object can now add this RowSet
object based on the match column.
setMatchColumn
in interface Joinable
columnIdxes
- an array of int
identifying the indexes of the
columns to be set as the match columns
java.sql.SQLException
- if an invalid column index is setJoinable.setMatchColumn(int[])
,
Joinable.unsetMatchColumn(int[])
public void setMatchColumn(java.lang.String[] columnNames) throws java.sql.SQLException
Joinable
RowSet
object. A JoinRowSet
object can now add this RowSet
object based on the match column.
setMatchColumn
in interface Joinable
columnNames
- an array of String
objects giving the names
of the column to be set as the match columns
java.sql.SQLException
- if in invalid column name is set; if the column name
is a null or an empty stringJoinable.unsetMatchColumn(int)
,
Joinable.setMatchColumn(int[])
public void setMatchColumn(int columnIdx) throws java.sql.SQLException
Joinable
RowSet
object. A JoinRowSet
object can now add this RowSet
object based on the match column.
Sub-interfaces such as the CachedRowSet
TM
interface define the method CachedRowSet.setKeyColumns
, which allows
primary key semantics to be enforced on specific columns.
Implementations of the setMatchColumn(int columnIdx)
method
should ensure that the constraints on the key columns are maintained when
a CachedRowSet
object sets a primary key column as a match column.
setMatchColumn
in interface Joinable
columnIdx
- an int
identifying the index of the column to be
set as the match column
java.sql.SQLException
- if an invalid column index is setJoinable.setMatchColumn(int[])
,
Joinable.unsetMatchColumn(int)
public void setMatchColumn(java.lang.String columnName) throws java.sql.SQLException
Joinable
RowSet
object. A JoinRowSet
object can now add this RowSet
object based on the match column.
Sub-interfaces such as the CachedRowSet
interface define
the method CachedRowSet.setKeyColumns
, which allows
primary key semantics to be enforced on specific columns.
Implementations of the setMatchColumn(String columnIdx)
method
should ensure that the constraints on the key columns are maintained when
a CachedRowSet
object sets a primary key column as a match column.
setMatchColumn
in interface Joinable
columnName
- a String
object giving the name of the column
to be set as the match column
java.sql.SQLException
- if in invalid column name is set; if the column name
is a null or an empty stringJoinable.unsetMatchColumn(int)
,
Joinable.setMatchColumn(int[])
public void unsetMatchColumn(int columnIdx) throws java.sql.SQLException
Joinable
RowSet
object.
RowSet
objects that implement the Joinable
interface
must ensure that a key-like constraint continues to be enforced until the
method CachedRowSet.unsetKeyColumns
has been called on the
designated column.
unsetMatchColumn
in interface Joinable
columnIdx
- an int
that identifies the index of the column
that is to be unset as a match column
java.sql.SQLException
- if an invalid column index is designated or if
the designated column was not previously set as a match
columnJoinable.setMatchColumn(int)
public void unsetMatchColumn(java.lang.String columnName) throws java.sql.SQLException
Joinable
RowSet
object.
RowSet
objects that implement the Joinable
interface
must ensure that a key-like constraint continues to be enforced until the
method CachedRowSet.unsetKeyColumns
has been called on the
designated column.
unsetMatchColumn
in interface Joinable
columnName
- a String
object giving the name of the column
that is to be unset as a match column
java.sql.SQLException
- if an invalid column name is designated or
the designated column was not previously set as a match
columnJoinable.setMatchColumn(int)
public void rowSetPopulated(javax.sql.RowSetEvent event, int numRows) throws java.sql.SQLException
CachedRowSet
numRows
parameter
ensures that this event will only be fired every numRow
.
The source of the event can be retrieved with the method event.getSource.
rowSetPopulated
in interface CachedRowSet
event
- a RowSetEvent
object that contains the
RowSet
object that is the source of the eventsnumRows
- when populating, the number of rows interval on which the
CachedRowSet
populated should fire; the default value
is zero; cannot be less than fetchSize
or zero
java.sql.SQLException
public void populate(java.sql.ResultSet data, int start) throws java.sql.SQLException
CachedRowSet
CachedRowSet
object with data from
the given ResultSet
object. While related to the populate(ResultSet)
method, an additional parameter is provided to allow starting position within
the ResultSet
from where to populate the CachedRowSet
instance.
This method can be used as an alternative to the execute
method when an
application has a connection to an open ResultSet
object.
Using the method populate
can be more efficient than using
the version of the execute
method that takes no parameters
because it does not open a new connection and re-execute this
CachedRowSet
object's command. Using the populate
method is more a matter of convenience when compared to using the version
of execute
that takes a ResultSet
object.
populate
in interface CachedRowSet
start
- thedata
- the ResultSet
object containing the data
to be read into this CachedRowSet
object
java.sql.SQLException
- if a null ResultSet
object is supplied
or this CachedRowSet
object cannot
retrieve the associated ResultSetMetaData
objectCachedRowSet.execute(java.sql.Connection)
,
CachedRowSet.populate(ResultSet)
,
ResultSet
,
ResultSetMetaData
public boolean nextPage() throws java.sql.SQLException
CachedRowSet
CachedRowSet
. This causes
the CachedRowSet
implementation to fetch the next page-size
rows and populate the RowSet, if remaining rows remain within scope of the
original SQL query used to populated the RowSet.
nextPage
in interface CachedRowSet
java.sql.SQLException
- if an error occurs fetching the next page, or if this
method is called prematurely before populate or execute.public void setPageSize(int size) throws java.sql.SQLException
CachedRowSet
CachedRowSet
object's page-size. A CachedRowSet
may be configured to populate itself in page-size sized batches of rows. When
either populate()
or execute()
are called, the
CachedRowSet
fetches an additional page according to the
original SQL query used to populate the RowSet.
setPageSize
in interface CachedRowSet
size
- the page-size of the CachedRowSet
java.sql.SQLException
public int getPageSize()
CachedRowSet
CachedRowSet
object
getPageSize
in interface CachedRowSet
int
page sizepublic boolean previousPage() throws java.sql.SQLException
CachedRowSet
CachedRowSet
. This causes
the CachedRowSet
implementation to fetch the previous page-size
rows and populate the RowSet. The amount of rows returned in the previous
page must always remain within scope of the original SQL query used to
populate the RowSet.
previousPage
in interface CachedRowSet
java.sql.SQLException
- if an error occurs fetching the previous page, or if
this method is called prematurely before populate or execute.public java.lang.String getCatalogName()
tableName
property
resides.
getCatalogName
in interface CachedRowSetX
String
object giving the name of the catalog that contains
the table referred to by tableName
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
ResultSetMetaData.getCatalogName(int)
public void setCatalogName(java.lang.String catalogName)
tableName
property.
The writer uses this name to determine which table to use when comparing the values in
the data source with the CachedRowSetX
object's values during a
synchronization attempt.
The catalogName
property also indicates where modified values from this
CachedRowSetX
object should be written.
The implementation of this CachedRowSetX
object may obtain the
the name internally from the RowSetMetaDataXImpl
object.
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
setCatalogName
in interface CachedRowSetX
catalogName
- a String
object identifying the catalog of the table
from which this CachedRowSetX
object was derived; can be
null
or an empty String
RowSetMetaData.setCatalogName(int, java.lang.String)
,
RowSetWriter
,
javax.sql.rowset.spi.SyncProviderX
public java.lang.String getSchemaName()
tableName
property
resides.
getSchemaName
in interface CachedRowSetX
String
object giving the name of the catalog that contains
the table referred to by tableName
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
ResultSetMetaData.getCatalogName(int)
public void setSchemaName(java.lang.String schemaName)
tableName
property.
The writer uses this name to determine which table to use when comparing the values in
the data source with the CachedRowSetX
object's values during a
synchronization attempt.
The schemaName
property also indicates where modified values from this
CachedRowSetX
object should be written.
The implementation of this CachedRowSetX
object may obtain the
the name internally from the RowSetMetaDataXImpl
object.
setSchemaName
in interface CachedRowSetX
schemaName
- a String
object identifying the schema of the table
from which this CachedRowSetX
object was derived; can be
null
or an empty String
RowSetMetaData.setSchemaName(int, java.lang.String)
,
RowSetWriter
,
javax.sql.rowset.spi.SyncProviderX
public java.lang.String[] getColumnCatalogNames()
String
. If setColumnCatalogNames
was never called,
null
is returned, else the value set when calling
setColumnCatalogNames{/code> is returned. See setColumnCatalogNames
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
- Specified by:
getColumnCatalogNames
in interface CachedRowSetX
- Returns:
- an array of
String
objects or null
public java.lang.String getColumnCatalogNames(int index)
String
which contains the catalog name set for the column or
null
.
Note, the column is zero based whereas most jdbc calls are one based.
getColumnCatalogNames
in interface CachedRowSetX
String
object or null
public void setColumnCatalogNames(java.lang.String[] columnCatalogNames)
columnCatalogNames
property.
setColumnCatalogNames
in interface CachedRowSetX
columnCatalogNames
- an array of String
, one for each column, which contains
the name of catalog of the corresponding column (each element can also be
null
Note, the column is zero based whereas most jdbc calls are one based.
public void setColumnCatalogNames(int index, java.lang.String columnCatalogName)
columnCatalogNames
property.
setColumnCatalogNames
in interface CachedRowSetX
index
- the index of the array to set (zero based)columnCatalogName
- the name of catalog for the column (can also be null
public java.lang.String[] getColumnSchemaNames()
String
. If setColumnSchemaNames
was never called,
null
is returned, else the value set when calling
setColumnSchemaNames{/code> is returned. See setColumnSchemaNames
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
- Specified by:
getColumnSchemaNames
in interface CachedRowSetX
- Returns:
- an array of
String
objects or null
public java.lang.String getColumnSchemaNames(int index)
String
which contains the schema name set for the column or
null
.
Note, the column is zero based whereas most jdbc calls are one based.
getColumnSchemaNames
in interface CachedRowSetX
String
object or null
public void setColumnSchemaNames(java.lang.String[] columnSchemaNames)
columnSchemaNames
property.
setColumnSchemaNames
in interface CachedRowSetX
columnSchemaNames
- an array of String
, one for each column, which contains
the name of schema of the corresponding column (each element can also be
null
Note, the column is zero based whereas most jdbc calls are one based.
public void setColumnSchemaNames(int index, java.lang.String columnSchemaName)
columnSchemaNames
property.
setColumnSchemaNames
in interface CachedRowSetX
index
- the index of the array to set (zero based)columnSchemaName
- the name of schema for the column (can also be null
public java.lang.String[] getColumnTableNames()
String
. If setColumnTableNames
was never called,
null
is returned, else the value set when calling
setColumnTableNames{/code> is returned. See setColumnTableNames
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
- Specified by:
getColumnTableNames
in interface CachedRowSetX
- Returns:
- an array of
String
objects or null
public java.lang.String getColumnTableNames(int index)
String
which contains the table name set for the column or
null
.
Note, the column is zero based whereas most jdbc calls are one based.
getColumnTableNames
in interface CachedRowSetX
String
object or null
public void setColumnTableNames(java.lang.String[] columnTableNames)
columnTableNames
property.
setColumnTableNames
in interface CachedRowSetX
columnTableNames
- an array of String
, one for each column, which contains
the name of table of the corresponding column (each element can also be
null
Note, the column is zero based whereas most jdbc calls are one based.
public void setColumnTableNames(int index, java.lang.String columnTableName)
columnTableNames
property.
setColumnTableNames
in interface CachedRowSetX
index
- the index of the array to set (zero based)columnTableName
- the name of table for the column (can also be null
public java.lang.String[] getColumnNames()
String
. If setColumnNames
was never called,
null
is returned, else the value set when calling
setColumnNames{/code> is returned. See setColumnNames
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
- Specified by:
getColumnNames
in interface CachedRowSetX
- Returns:
- an array of
String
objects or null
public java.lang.String getColumnNames(int index)
String
which contains the column name set for the column or
null
.
Note, the column is zero based whereas most jdbc calls are one based.
getColumnNames
in interface CachedRowSetX
String
object or null
public void setColumnNames(java.lang.String[] columnNames)
columnNames
property.
setColumnNames
in interface CachedRowSetX
columnNames
- an array of String
, one for each column, which contains
the name of column (each element can also be null
Note, the column is zero based whereas most jdbc calls are one based.
public void setColumnNames(int index, java.lang.String columnName)
columnNames
property.
setColumnNames
in interface CachedRowSetX
index
- the index of the array to set (zero based)columnName
- for the column (can also be null
public boolean[] getInsertableColumns()
boolean{/code>. If setInsertableColumns
was never called,
null
is returned, else the value set when calling
setInsertableColumns{/code> is returned. See setInsertableColumns
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
- Specified by:
getInsertableColumns
in interface CachedRowSetX
- Returns:
- an array of
boolean{/code> objects or null
public boolean getInsertableColumns(int index)
boolean{/code> of true
if the column should be inserted when
when adding rows or null
.
Note, the column is zero based whereas most jdbc calls are one based.
- Specified by:
getInsertableColumns
in interface CachedRowSetX
- Returns:
- a
boolean/code> object or null
public void setInsertableColumns(boolean[] insertableColumns)
insertableColumns
property.
setInsertableColumns
in interface CachedRowSetX
insertableColumns
- an array of boolean
one for each column, which contains
a boolean indicating whether or not the column should be inserted when adding
rows to the CachedRowSetX
Note, the column is zero based whereas most jdbc calls are one based.
public void setInsertableColumns(int index, boolean insertableColumn)
insertableColumns
property.
setInsertableColumns
in interface CachedRowSetX
index
- the index of the array to set (zero based)insertableColumn
- true if column should be inserted for new rowspublic boolean[] getUpdatableColumns()
boolean{/code>. If setUpdatableColumns
was never called,
null
is returned, else the value set when calling
setUpdatebleColumns{/code> is returned. See setUpdatableColumns
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
- Specified by:
getUpdatableColumns
in interface CachedRowSetX
- Returns:
- an array of
boolean{/code> objects or null
public boolean getUpdatableColumns(int index)
boolean{/code> of true
if the column should be updated when
when updating rows or null
.
Note, the column is zero based whereas most jdbc calls are one based.
- Specified by:
getUpdatableColumns
in interface CachedRowSetX
- Returns:
- a
boolean{/code> object or null
public void setUpdatableColumns(boolean[] updatableColumns)
updatableColumns
property.
setUpdatableColumns
in interface CachedRowSetX
updatableColumns
- an array of boolean
, one for each column, which contains
a boolean indicating whether or not the column should be updated when updating
rows to the CachedRowSetX
Note, the column is zero based whereas most jdbc calls are one based.
public void setUpdatableColumns(int index, boolean updatableColumn)
updatableColumns
property.
setUpdatableColumns
in interface CachedRowSetX
index
- the index of the array to set (zero based)updatableColumn
- true if column should be updated when rows are updatedpublic boolean getPrintStatements()
printStatements
property.
getPrintStatements
in interface CachedRowSetX
boolean{/code> object which, if true, causes SQL statements to be written to
System.out
.
Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter
.
public void setPrintStatements(boolean printStatements)
printStatements
property.
If this property is true
,
SQL Insert
, UPDATE
and DELETE
statements will
be written to System.out
. This property is intended to be set when debugging
problems inserting, updating and deleting. With the information gained from examining the
output, it is intended that one can set the other advanced properties on the
CachedRowSetX
to "fix" the SQL statements being generated. In this way,
some JDBC driver problems can be overcome.
setPrintStatements
in interface CachedRowSetX
printStatements
- a boolean{/code> object which determines whether
SQL Insert
, UPDATE
and DELETE
statements are
written to System.out
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |