com.sun.sql.rowset
Class CachedRowSetXImpl

java.lang.Object
  extended byjavax.sql.rowset.BaseRowSet
      extended bycom.sun.sql.rowset.BaseRowSetX
          extended bycom.sun.sql.rowset.CachedRowSetXImpl
All Implemented Interfaces:
CachedRowSet, CachedRowSetX, java.lang.Cloneable, Joinable, java.sql.ResultSet, javax.sql.RowSet, javax.sql.RowSetInternal, java.io.Serializable

public class CachedRowSetXImpl
extends BaseRowSetX
implements CachedRowSetX, javax.sql.RowSetInternal, java.io.Serializable, java.lang.Cloneable

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

See Also:
Serialized Form

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 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.

 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 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.

 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 WebRowSet object instance to export the RowSet schema definition to XML for future use.

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 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.

 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 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.

 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 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.

 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 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.

 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 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.

 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 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.

 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 CachedRowSetXImplobject.
 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 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.

 boolean getInsertableColumns(int index)
          Returns a 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.

 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 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.

 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 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.

 boolean getUpdatableColumns(int index)
          Returns a 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.

 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 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.

 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 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.

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 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.

 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 CachedRowSetX object may obtain the the name internally from the RowSetMetaDataXImpl object.

Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter.

 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 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.

 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 CachedRowSetX object may obtain the the name internally from the RowSetMetaDataXImpl object.

 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 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.

 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 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).

 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 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.

 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 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.

 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 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.

 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 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.

 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:

  • CachedRowSet.absolute
  • CachedRowSet.first
  • CachedRowSet.last
 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:

  • CachedRowSet.absolute
  • CachedRowSet.first
  • CachedRowSet.last
 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.

undoUpdate

 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 javax.sql.rowset.BaseRowSet
addRowSetListener, clearParameters, getCommand, getConcurrency, getDataSourceName, getEscapeProcessing, getMaxFieldSize, getParams, getPassword, getQueryTimeout, getShowDeleted, getTransactionIsolation, getType, getTypeMap, getUrl, getUsername, isReadOnly, notifyCursorMoved, notifyRowChanged, notifyRowSetChanged, 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, setShowDeleted, setString, setTime, setTime, setTimestamp, setTimestamp, setTypeMap
 
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

internalUseInstance

protected boolean internalUseInstance
The 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

CachedRowSetXImpl

public CachedRowSetXImpl()
Constructs a default 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 = 0
 
A CachedRowSetXImpl object is configured to use the default RIOptimisticProvider implementation to provide connectivity and synchronization capabilities to the set data source.


CachedRowSetXImpl

public CachedRowSetXImpl(java.util.Hashtable env)
                  throws java.sql.SQLException
Provides a 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 = 0
 
However, 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:

More specific detailes are available in the SyncFactory and SyncProvider specificiations later in this document.

Parameters:
env - a Hashtable object with a list of desired synchronization providers
Throws:
java.sql.SQLException - if the requested provider cannot be found by the synchonization factory
See Also:
SyncProvider
Method Detail

createInternalUseInstance

public static CachedRowSetXImpl createInternalUseInstance()
used internally by readers and writers


initParams

protected void initParams()
Description copied from class: BaseRowSet
Performs the necessary internal configurations and initializations to allow any JDBC 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.

Overrides:
initParams in class BaseRowSet

isExecuted

public boolean isExecuted()
                   throws java.sql.SQLException
Returns true if this rowset is in an executed state

Specified by:
isExecuted in interface CachedRowSetX
Returns:
a 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.
Throws:
java.sql.SQLException - if a database access error occurs

setDataSourceName

public void setDataSourceName(java.lang.String dataSourceName)
                       throws java.sql.SQLException
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.

Specified by:
setDataSourceName in interface javax.sql.RowSet
Overrides:
setDataSourceName in class BaseRowSetX
Parameters:
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
Throws:
java.sql.SQLException - if there is a problem setting the dataSourceName property or name is an empty string
See Also:
BaseRowSet.getDataSourceName()

setUrl

public void setUrl(java.lang.String url)
            throws java.sql.SQLException
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 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.

Specified by:
setUrl in interface javax.sql.RowSet
Overrides:
setUrl in class BaseRowSetX
Parameters:
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
Throws:
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)
See Also:
BaseRowSet.getUrl()

setUsername

public 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.

Specified by:
setUsername in interface javax.sql.RowSet
Overrides:
setUsername in class BaseRowSet
Parameters:
username - the String object containing the user name that is supplied to the data source to create a connection. It may be null.
See Also:
BaseRowSet.getUsername()

setPassword

public 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.

Specified by:
setPassword in interface javax.sql.RowSet
Overrides:
setPassword in class BaseRowSet
Parameters:
password - the String object that represents the password that is supplied to the database to create a connection. It may be null.
See Also:
BaseRowSet.getPassword()

setType

public void setType(int type)
             throws java.sql.SQLException
Sets the type for this RowSet object to the specified type. The default type is ResultSet.TYPE_SCROLL_INSENSITIVE.

Specified by:
setType in interface javax.sql.RowSet
Overrides:
setType in class BaseRowSet
Parameters:
type - one of the following constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
Throws:
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
See Also:
BaseRowSet.getConcurrency(), BaseRowSet.getType()

setConcurrency

public void setConcurrency(int concurrency)
                    throws java.sql.SQLException
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.

Specified by:
setConcurrency in interface javax.sql.RowSet
Overrides:
setConcurrency in class BaseRowSet
Parameters:
concurrency - one of the following constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
Throws:
java.sql.SQLException - if the parameter supplied is not one of the following constants: ResultSet.CONCUR_UPDATABLE or ResultSet.CONCUR_READ_ONLY
See Also:
BaseRowSet.getConcurrency(), BaseRowSet.isReadOnly()

setTransactionIsolation

public void setTransactionIsolation(int transactionIsolation)
                             throws java.sql.SQLException
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 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).

Specified by:
setTransactionIsolation in interface javax.sql.RowSet
Overrides:
setTransactionIsolation in class BaseRowSet
Parameters:
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
Throws:
java.sql.SQLException - if the given parameter is not one of the Connection constants
See Also:
SyncFactory, SyncProvider, BaseRowSet.getTransactionIsolation()

setMaxRows

public void setMaxRows(int maxRows)
                throws java.sql.SQLException
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.

Specified by:
setMaxRows in interface javax.sql.RowSet
Overrides:
setMaxRows in class BaseRowSetX
Parameters:
maxRows - an int indicating the current maximum number of rows; zero means that there is no limit
Throws:
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

setReadOnly

public void setReadOnly(boolean isReadOnly)
Sets this RowSet object's readOnly property to the given boolean.

Specified by:
setReadOnly in interface javax.sql.RowSet
Overrides:
setReadOnly in class BaseRowSet
Parameters:
isReadOnly - true to indicate that this RowSet object is read-only; false to indicate that it is updatable

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all bound properties.

Specified by:
addPropertyChangeListener in interface CachedRowSetX
Parameters:
listener - The PropertyChangeListener to be added

addPropertyChangeListener

public 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.

Specified by:
addPropertyChangeListener in interface CachedRowSetX
Parameters:
propertyName - The name of the property to listen on.
listener - The PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.  

Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all bound properties.

Specified by:
removePropertyChangeListener in interface CachedRowSetX
Parameters:
listener - The PropertyChangeListener to be removed

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.

Specified by:
removePropertyChangeListener in interface CachedRowSetX
Parameters:
propertyName - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed

setCommand

public void setCommand(java.lang.String command)
                throws java.sql.SQLException
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 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.

Specified by:
setCommand in interface javax.sql.RowSet
Overrides:
setCommand in class BaseRowSetX
Parameters:
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
Throws:
java.sql.SQLException - if an empty string is provided as the command value
See Also:
BaseRowSet.getCommand()

populate

public void populate(java.sql.ResultSet data)
              throws java.sql.SQLException
Populates this 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.

Specified by:
populate in interface CachedRowSet
Parameters:
data - the ResultSet object containing the data to be read into this CachedRowSet object
Throws:
java.sql.SQLException - if a null ResultSet object is supplied or this CachedRowSet object cannot retrieve the associated ResultSetMetaData object
See Also:
CachedRowSet.execute(java.sql.Connection), ResultSet, ResultSetMetaData

execute

public void execute(java.sql.Connection conn)
             throws java.sql.SQLException
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 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.

Specified by:
execute in interface CachedRowSet
Parameters:
conn - a standard JDBC Connection object with valid properties
Throws:
java.sql.SQLException - if an invalid Connection object is supplied or an error occurs in establishing the connection to the data source
See Also:
CachedRowSet.populate(java.sql.ResultSet), Connection

acceptChanges

public void acceptChanges()
                   throws SyncProviderException
Propagates row update, insert and delete changes made to this 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.

Specified by:
acceptChanges in interface CachedRowSet
Throws:
SyncProviderException - if the underlying synchronization provider's writer fails to write the updates back to the data source
See Also:
CachedRowSet.acceptChanges(java.sql.Connection), RowSetWriter, SyncFactory, SyncProvider, SyncProviderException, SyncResolver

acceptChanges

public void acceptChanges(java.sql.Connection con)
                   throws SyncProviderException
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 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.

Specified by:
acceptChanges in interface CachedRowSet
Parameters:
con - a standard JDBC Connection object
Throws:
SyncProviderException - if the underlying synchronization provider's writer fails to write the updates back to the data source
See Also:
CachedRowSet.acceptChanges(), RowSetWriter, SyncFactory, SyncProvider, SyncProviderException, SyncResolver

restoreOriginal

public void restoreOriginal()
                     throws java.sql.SQLException
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 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.

Specified by:
restoreOriginal in interface CachedRowSet
Throws:
java.sql.SQLException - if an error occurs rolling back the current value of this CachedRowSet object to its previous value
See Also:
RowSetListener.rowSetChanged(javax.sql.RowSetEvent)

release

public void release()
             throws java.sql.SQLException
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 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.

Specified by:
release in interface CachedRowSet
Throws:
java.sql.SQLException - if an error occurs flushing the contents of this CachedRowSet object
See Also:
RowSetListener.rowSetChanged(javax.sql.RowSetEvent), ResultSet.close()

undoDelete

public void undoDelete()
                throws java.sql.SQLException
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:

Specified by:
undoDelete in interface CachedRowSet
Throws:
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 row
See Also:
CachedRowSet.undoInsert(), ResultSet.cancelRowUpdates()

undoInsert

public void undoInsert()
                throws java.sql.SQLException
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:

Specified by:
undoInsert in interface CachedRowSet
Throws:
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 row
See Also:
CachedRowSet.undoDelete(), ResultSet.cancelRowUpdates()

undoUpdate

public void undoUpdate()
                throws java.sql.SQLException
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.

undoUpdate

Specified by:
undoUpdate in interface CachedRowSet
Throws:
java.sql.SQLException - if the cursor is before the first row or after the last row in in this CachedRowSet object
See Also:
CachedRowSet.undoDelete(), CachedRowSet.undoInsert(), ResultSet.cancelRowUpdates()

createShared

public javax.sql.RowSet createShared()
                              throws java.sql.SQLException
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 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.

Specified by:
createShared in interface CachedRowSet
Returns:
a new shared RowSet object that has the same properties as this CachedRowSet object and that has a cursor over the same data
Throws:
java.sql.SQLException - if an error occurs or cloning is not supported in the underlying platform
See Also:
RowSetEvent, RowSetListener

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Returns a new 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.

Returns:
a copy of this CachedRowSetXImpl object
Throws:
java.lang.CloneNotSupportedException - if an error occurs when attempting to clone this CachedRowSetXImpl object
See Also:
createShared()

createCopy

public CachedRowSet createCopy()
                        throws java.sql.SQLException
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.

Specified by:
createCopy in interface CachedRowSet
Returns:
a new CachedRowSet object that is a deep copy of the CachedRowSet object instance and is completely independent of its originating CachedRowSet
Throws:
java.sql.SQLException - if an error occurs in generating the copy of the of the CachedRowSet
See Also:
CachedRowSet.createShared(), CachedRowSet.createCopySchema(), CachedRowSet.createCopyNoConstraints(), RowSetEvent, RowSetListener

createCopySchema

public CachedRowSet createCopySchema()
                              throws java.sql.SQLException
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 WebRowSet object instance to export the RowSet schema definition to XML for future use.

Specified by:
createCopySchema in interface CachedRowSet
Throws:
java.sql.SQLException - if an error occurs when cloning the originating CachedRowSet structure
See Also:
CachedRowSet.createShared(), CachedRowSet.createCopySchema(), CachedRowSet.createCopyNoConstraints(), RowSetEvent, RowSetListener

createCopyNoConstraints

public CachedRowSet createCopyNoConstraints()
                                     throws java.sql.SQLException
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.

Specified by:
createCopyNoConstraints in interface CachedRowSet
Returns:
a new CachedRowSet object that is a deep copy of the CachedRowSet object instance and is completely independent of its originating CachedRowSet
Throws:
java.sql.SQLException - if an error occurs in generating the copy of the of the CachedRowSet
See Also:
CachedRowSet.createCopy(), CachedRowSet.createShared(), CachedRowSet.createCopySchema(), RowSetEvent, RowSetListener

toCollection

public java.util.Collection toCollection()
                                  throws java.sql.SQLException
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 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.

Specified by:
toCollection in interface CachedRowSet
Returns:
a Collection object that contains the values in each row in this CachedRowSet object
Throws:
java.sql.SQLException - if an error occurs generating the collection
See Also:
CachedRowSet.toCollection(int), CachedRowSet.toCollection(String)

toCollection

public java.util.Collection toCollection(int column)
                                  throws java.sql.SQLException
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 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.

Specified by:
toCollection in interface CachedRowSet
Parameters:
column - an int indicating the column whose values are to be represented in a Collection object
Returns:
a Collection object that contains the values stored in the specified column of this CachedRowSet object
Throws:
java.sql.SQLException - if an error occurs generating the collection or an invalid column id is provided
See Also:
CachedRowSet.toCollection(), CachedRowSet.toCollection(String)

toCollection

public java.util.Collection toCollection(java.lang.String column)
                                  throws java.sql.SQLException
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 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.

Specified by:
toCollection in interface CachedRowSet
Parameters:
column - a String object giving the name of the column whose values are to be represented in a collection
Returns:
a Collection object that contains the values stored in the specified column of this CachedRowSet object
Throws:
java.sql.SQLException - if an error occurs generating the collection or an invalid column id is provided
See Also:
CachedRowSet.toCollection(), CachedRowSet.toCollection(int)

getSyncProvider

public SyncProvider getSyncProvider()
                             throws java.sql.SQLException
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 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.

Specified by:
getSyncProvider in interface CachedRowSet
Returns:
the SyncProvider object that was set when the rowset was instantiated, or if none was was set, the default provider
Throws:
java.sql.SQLException - if an error occurs while returning the SyncProvider object
See Also:
CachedRowSet.setSyncProvider(java.lang.String)

setSyncProvider

public void setSyncProvider(java.lang.String providerStr)
                     throws java.sql.SQLException
Sets the 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.

Specified by:
setSyncProvider in interface CachedRowSet
Parameters:
providerStr - a String object giving the fully qualified class name of a SyncProvider implementation
Throws:
java.sql.SQLException - if an error occurs while attempting to reset the SyncProvider implementation
See Also:
CachedRowSet.getSyncProvider()

execute

public void execute()
             throws java.sql.SQLException

Specified by:
execute in interface javax.sql.RowSet
Throws:
java.sql.SQLException

next

public boolean next()
             throws java.sql.SQLException

Specified by:
next in interface java.sql.ResultSet
Throws:
java.sql.SQLException

internalNext

protected boolean internalNext()
                        throws java.sql.SQLException
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.

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.

Returns:
true if the cursor is on a valid row in this rowset; false if it is after the last row
Throws:
java.sql.SQLException - if an error occurs

close

public void close()

Specified by:
close in interface java.sql.ResultSet

wasNull

public boolean wasNull()
                throws java.sql.SQLException

Specified by:
wasNull in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getCurrentRow

protected BaseRow getCurrentRow()
                         throws java.sql.SQLException
Returns the insert row or the current row of this CachedRowSetXImplobject.

Returns:
the Row object on which this CachedRowSetXImpl objects's cursor is positioned
Throws:
java.sql.SQLException

removeCurrentRow

protected void removeCurrentRow()
                         throws java.sql.SQLException
Removes the row on which the cursor is positioned.

This is a implementation only method and is not required as a standard implementation of the CachedRowSet interface.

Throws:
java.sql.SQLException - if the cursor is positioned on the insert row

getString

public java.lang.String getString(int columnIndex)
                           throws java.sql.SQLException

Specified by:
getString in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBoolean

public boolean getBoolean(int columnIndex)
                   throws java.sql.SQLException

Specified by:
getBoolean in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getByte

public byte getByte(int columnIndex)
             throws java.sql.SQLException

Specified by:
getByte in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getShort

public short getShort(int columnIndex)
               throws java.sql.SQLException

Specified by:
getShort in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getInt

public int getInt(int columnIndex)
           throws java.sql.SQLException
Specified by:
getInt in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getLong

public long getLong(int columnIndex)
             throws java.sql.SQLException

Specified by:
getLong in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getFloat

public float getFloat(int columnIndex)
               throws java.sql.SQLException

Specified by:
getFloat in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getDouble

public double getDouble(int columnIndex)
                 throws java.sql.SQLException

Specified by:
getDouble in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBigDecimal

public java.math.BigDecimal getBigDecimal(int columnIndex,
                                          int scale)
                                   throws java.sql.SQLException

Specified by:
getBigDecimal in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBytes

public byte[] getBytes(int columnIndex)
                throws java.sql.SQLException

Specified by:
getBytes in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getDate

public java.sql.Date getDate(int columnIndex)
                      throws java.sql.SQLException

Specified by:
getDate in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getTime

public java.sql.Time getTime(int columnIndex)
                      throws java.sql.SQLException

Specified by:
getTime in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getTimestamp

public java.sql.Timestamp getTimestamp(int columnIndex)
                                throws java.sql.SQLException

Specified by:
getTimestamp in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getAsciiStream

public java.io.InputStream getAsciiStream(int columnIndex)
                                   throws java.sql.SQLException

Specified by:
getAsciiStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getUnicodeStream

public java.io.InputStream getUnicodeStream(int columnIndex)
                                     throws java.sql.SQLException

Specified by:
getUnicodeStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBinaryStream

public java.io.InputStream getBinaryStream(int columnIndex)
                                    throws java.sql.SQLException

Specified by:
getBinaryStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getString

public java.lang.String getString(java.lang.String columnName)
                           throws java.sql.SQLException

Specified by:
getString in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBoolean

public boolean getBoolean(java.lang.String columnName)
                   throws java.sql.SQLException

Specified by:
getBoolean in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getByte

public byte getByte(java.lang.String columnName)
             throws java.sql.SQLException

Specified by:
getByte in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getShort

public short getShort(java.lang.String columnName)
               throws java.sql.SQLException

Specified by:
getShort in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getInt

public int getInt(java.lang.String columnName)
           throws java.sql.SQLException

Specified by:
getInt in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getLong

public long getLong(java.lang.String columnName)
             throws java.sql.SQLException

Specified by:
getLong in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getFloat

public float getFloat(java.lang.String columnName)
               throws java.sql.SQLException

Specified by:
getFloat in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getDouble

public double getDouble(java.lang.String columnName)
                 throws java.sql.SQLException

Specified by:
getDouble in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String columnName,
                                          int scale)
                                   throws java.sql.SQLException

Specified by:
getBigDecimal in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBytes

public byte[] getBytes(java.lang.String columnName)
                throws java.sql.SQLException

Specified by:
getBytes in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getDate

public java.sql.Date getDate(java.lang.String columnName)
                      throws java.sql.SQLException

Specified by:
getDate in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getTime

public java.sql.Time getTime(java.lang.String columnName)
                      throws java.sql.SQLException

Specified by:
getTime in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String columnName)
                                throws java.sql.SQLException

Specified by:
getTimestamp in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getAsciiStream

public java.io.InputStream getAsciiStream(java.lang.String columnName)
                                   throws java.sql.SQLException

Specified by:
getAsciiStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getUnicodeStream

public java.io.InputStream getUnicodeStream(java.lang.String columnName)
                                     throws java.sql.SQLException

Specified by:
getUnicodeStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBinaryStream

public java.io.InputStream getBinaryStream(java.lang.String columnName)
                                    throws java.sql.SQLException

Specified by:
getBinaryStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getWarnings

public java.sql.SQLWarning getWarnings()

Specified by:
getWarnings in interface java.sql.ResultSet

clearWarnings

public void clearWarnings()

Specified by:
clearWarnings in interface java.sql.ResultSet

getCursorName

public java.lang.String getCursorName()
                               throws java.sql.SQLException

Specified by:
getCursorName in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getMetaData

public java.sql.ResultSetMetaData getMetaData()
                                       throws java.sql.SQLException

Specified by:
getMetaData in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getObject

public java.lang.Object getObject(int columnIndex)
                           throws java.sql.SQLException

Specified by:
getObject in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getObject

public java.lang.Object getObject(java.lang.String columnName)
                           throws java.sql.SQLException

Specified by:
getObject in interface java.sql.ResultSet
Throws:
java.sql.SQLException

findColumn

public int findColumn(java.lang.String columnName)
               throws java.sql.SQLException

Specified by:
findColumn in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getCharacterStream

public java.io.Reader getCharacterStream(int columnIndex)
                                  throws java.sql.SQLException

Specified by:
getCharacterStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getCharacterStream

public java.io.Reader getCharacterStream(java.lang.String columnName)
                                  throws java.sql.SQLException

Specified by:
getCharacterStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBigDecimal

public java.math.BigDecimal getBigDecimal(int columnIndex)
                                   throws java.sql.SQLException

Specified by:
getBigDecimal in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String columnName)
                                   throws java.sql.SQLException

Specified by:
getBigDecimal in interface java.sql.ResultSet
Throws:
java.sql.SQLException

size

public int size()
Returns the number of rows in this CachedRowSet object.

Specified by:
size in interface CachedRowSet
Returns:
number of rows in the rowset

isBeforeFirst

public boolean isBeforeFirst()
                      throws java.sql.SQLException

Specified by:
isBeforeFirst in interface java.sql.ResultSet
Throws:
java.sql.SQLException

isAfterLast

public boolean isAfterLast()
                    throws java.sql.SQLException

Specified by:
isAfterLast in interface java.sql.ResultSet
Throws:
java.sql.SQLException

isFirst

public boolean isFirst()
                throws java.sql.SQLException

Specified by:
isFirst in interface java.sql.ResultSet
Throws:
java.sql.SQLException

isLast

public boolean isLast()
               throws java.sql.SQLException

Specified by:
isLast in interface java.sql.ResultSet
Throws:
java.sql.SQLException

beforeFirst

public void beforeFirst()
                 throws java.sql.SQLException

Specified by:
beforeFirst in interface java.sql.ResultSet
Throws:
java.sql.SQLException

afterLast

public void afterLast()
               throws java.sql.SQLException

Specified by:
afterLast in interface java.sql.ResultSet
Throws:
java.sql.SQLException

first

public boolean first()
              throws java.sql.SQLException

Specified by:
first in interface java.sql.ResultSet
Throws:
java.sql.SQLException

internalFirst

protected boolean internalFirst()
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

last

public boolean last()
             throws java.sql.SQLException

Specified by:
last in interface java.sql.ResultSet
Throws:
java.sql.SQLException

internalLast

protected boolean internalLast()
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getRow

public int getRow()
           throws java.sql.SQLException

Specified by:
getRow in interface java.sql.ResultSet
Throws:
java.sql.SQLException

absolute

public boolean absolute(int row)
                 throws java.sql.SQLException

Specified by:
absolute in interface java.sql.ResultSet
Throws:
java.sql.SQLException

relative

public boolean relative(int rows)
                 throws java.sql.SQLException

Specified by:
relative in interface java.sql.ResultSet
Throws:
java.sql.SQLException

previous

public boolean previous()
                 throws java.sql.SQLException

Specified by:
previous in interface java.sql.ResultSet
Throws:
java.sql.SQLException

internalPrevious

protected boolean internalPrevious()
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

rowUpdated

public boolean rowUpdated()
                   throws java.sql.SQLException

Specified by:
rowUpdated in interface java.sql.ResultSet
Throws:
java.sql.SQLException

columnUpdated

public boolean columnUpdated(int idx)
                      throws java.sql.SQLException
Indicates whether the designated column in the current row of this CachedRowSet object has been updated.

Specified by:
columnUpdated in interface CachedRowSet
Parameters:
idx - an int identifying the column to be checked for updates
Returns:
true if the designated column has been visibly updated; false otherwise
Throws:
java.sql.SQLException - if the cursor is on the insert row, before the first row, or after the last row
See Also:
DatabaseMetaData.updatesAreDetected(int)

columnUpdated

public boolean columnUpdated(java.lang.String columnName)
                      throws java.sql.SQLException
Indicates whether the designated column in the current row of this CachedRowSet object has been updated.

Specified by:
columnUpdated in interface CachedRowSet
Parameters:
columnName - a String object giving the name of the column to be checked for updates
Returns:
true if the column has been visibly updated; false otherwise
Throws:
java.sql.SQLException - if the cursor is on the insert row, before the first row, or after the last row
See Also:
DatabaseMetaData.updatesAreDetected(int)

rowInserted

public boolean rowInserted()
                    throws java.sql.SQLException

Specified by:
rowInserted in interface java.sql.ResultSet
Throws:
java.sql.SQLException

rowDeleted

public boolean rowDeleted()
                   throws java.sql.SQLException

Specified by:
rowDeleted in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateNull

public void updateNull(int columnIndex)
                throws java.sql.SQLException

Specified by:
updateNull in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBoolean

public void updateBoolean(int columnIndex,
                          boolean x)
                   throws java.sql.SQLException

Specified by:
updateBoolean in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateByte

public void updateByte(int columnIndex,
                       byte x)
                throws java.sql.SQLException

Specified by:
updateByte in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateShort

public void updateShort(int columnIndex,
                        short x)
                 throws java.sql.SQLException

Specified by:
updateShort in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateInt

public void updateInt(int columnIndex,
                      int x)
               throws java.sql.SQLException

Specified by:
updateInt in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateLong

public void updateLong(int columnIndex,
                       long x)
                throws java.sql.SQLException

Specified by:
updateLong in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateFloat

public void updateFloat(int columnIndex,
                        float x)
                 throws java.sql.SQLException

Specified by:
updateFloat in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateDouble

public void updateDouble(int columnIndex,
                         double x)
                  throws java.sql.SQLException

Specified by:
updateDouble in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBigDecimal

public void updateBigDecimal(int columnIndex,
                             java.math.BigDecimal x)
                      throws java.sql.SQLException

Specified by:
updateBigDecimal in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateString

public void updateString(int columnIndex,
                         java.lang.String x)
                  throws java.sql.SQLException

Specified by:
updateString in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBytes

public void updateBytes(int columnIndex,
                        byte[] x)
                 throws java.sql.SQLException

Specified by:
updateBytes in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateDate

public void updateDate(int columnIndex,
                       java.sql.Date x)
                throws java.sql.SQLException

Specified by:
updateDate in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateTime

public void updateTime(int columnIndex,
                       java.sql.Time x)
                throws java.sql.SQLException

Specified by:
updateTime in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateTimestamp

public void updateTimestamp(int columnIndex,
                            java.sql.Timestamp x)
                     throws java.sql.SQLException

Specified by:
updateTimestamp in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(int columnIndex,
                              java.io.InputStream x,
                              int length)
                       throws java.sql.SQLException

Specified by:
updateAsciiStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(int columnIndex,
                               java.io.InputStream x,
                               int length)
                        throws java.sql.SQLException

Specified by:
updateBinaryStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(int columnIndex,
                                  java.io.Reader x,
                                  int length)
                           throws java.sql.SQLException

Specified by:
updateCharacterStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateObject

public void updateObject(int columnIndex,
                         java.lang.Object x,
                         int scale)
                  throws java.sql.SQLException

Specified by:
updateObject in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateObject

public void updateObject(int columnIndex,
                         java.lang.Object x)
                  throws java.sql.SQLException

Specified by:
updateObject in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateNull

public void updateNull(java.lang.String columnName)
                throws java.sql.SQLException

Specified by:
updateNull in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBoolean

public void updateBoolean(java.lang.String columnName,
                          boolean x)
                   throws java.sql.SQLException

Specified by:
updateBoolean in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateByte

public void updateByte(java.lang.String columnName,
                       byte x)
                throws java.sql.SQLException
Specified by:
updateByte in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateShort

public void updateShort(java.lang.String columnName,
                        short x)
                 throws java.sql.SQLException
Specified by:
updateShort in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateInt

public void updateInt(java.lang.String columnName,
                      int x)
               throws java.sql.SQLException
Specified by:
updateInt in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateLong

public void updateLong(java.lang.String columnName,
                       long x)
                throws java.sql.SQLException
Specified by:
updateLong in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateFloat

public void updateFloat(java.lang.String columnName,
                        float x)
                 throws java.sql.SQLException
Specified by:
updateFloat in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateDouble

public void updateDouble(java.lang.String columnName,
                         double x)
                  throws java.sql.SQLException
Specified by:
updateDouble in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBigDecimal

public void updateBigDecimal(java.lang.String columnName,
                             java.math.BigDecimal x)
                      throws java.sql.SQLException
Specified by:
updateBigDecimal in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateString

public void updateString(java.lang.String columnName,
                         java.lang.String x)
                  throws java.sql.SQLException
Specified by:
updateString in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBytes

public void updateBytes(java.lang.String columnName,
                        byte[] x)
                 throws java.sql.SQLException
Specified by:
updateBytes in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateDate

public void updateDate(java.lang.String columnName,
                       java.sql.Date x)
                throws java.sql.SQLException
Specified by:
updateDate in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateTime

public void updateTime(java.lang.String columnName,
                       java.sql.Time x)
                throws java.sql.SQLException
Specified by:
updateTime in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateTimestamp

public void updateTimestamp(java.lang.String columnName,
                            java.sql.Timestamp x)
                     throws java.sql.SQLException
Specified by:
updateTimestamp in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(java.lang.String columnName,
                              java.io.InputStream x,
                              int length)
                       throws java.sql.SQLException
Specified by:
updateAsciiStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(java.lang.String columnName,
                               java.io.InputStream x,
                               int length)
                        throws java.sql.SQLException
Specified by:
updateBinaryStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(java.lang.String columnName,
                                  java.io.Reader reader,
                                  int length)
                           throws java.sql.SQLException
Specified by:
updateCharacterStream in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateObject

public void updateObject(java.lang.String columnName,
                         java.lang.Object x,
                         int scale)
                  throws java.sql.SQLException
Specified by:
updateObject in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateObject

public void updateObject(java.lang.String columnName,
                         java.lang.Object x)
                  throws java.sql.SQLException
Specified by:
updateObject in interface java.sql.ResultSet
Throws:
java.sql.SQLException

insertRow

public void insertRow()
               throws java.sql.SQLException
Specified by:
insertRow in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateRow

public void updateRow()
               throws java.sql.SQLException
Specified by:
updateRow in interface java.sql.ResultSet
Throws:
java.sql.SQLException

deleteRow

public void deleteRow()
               throws java.sql.SQLException
Specified by:
deleteRow in interface java.sql.ResultSet
Throws:
java.sql.SQLException

refreshRow

public void refreshRow()
                throws java.sql.SQLException
Specified by:
refreshRow in interface java.sql.ResultSet
Throws:
java.sql.SQLException

cancelRowUpdates

public void cancelRowUpdates()
                      throws java.sql.SQLException
Specified by:
cancelRowUpdates in interface java.sql.ResultSet
Throws:
java.sql.SQLException

moveToInsertRow

public void moveToInsertRow()
                     throws java.sql.SQLException
Specified by:
moveToInsertRow in interface java.sql.ResultSet
Throws:
java.sql.SQLException

moveToCurrentRow

public void moveToCurrentRow()
                      throws java.sql.SQLException
Specified by:
moveToCurrentRow in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getStatement

public java.sql.Statement getStatement()
                                throws java.sql.SQLException
Returns null.

Specified by:
getStatement in interface java.sql.ResultSet
Returns:
null
Throws:
java.sql.SQLException - if an error occurs

getObject

public java.lang.Object getObject(int columnIndex,
                                  java.util.Map map)
                           throws java.sql.SQLException
Specified by:
getObject in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getRef

public java.sql.Ref getRef(int columnIndex)
                    throws java.sql.SQLException
Specified by:
getRef in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBlob

public java.sql.Blob getBlob(int columnIndex)
                      throws java.sql.SQLException
Specified by:
getBlob in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getClob

public java.sql.Clob getClob(int columnIndex)
                      throws java.sql.SQLException
Specified by:
getClob in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getArray

public java.sql.Array getArray(int columnIndex)
                        throws java.sql.SQLException
Specified by:
getArray in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getObject

public java.lang.Object getObject(java.lang.String columnName,
                                  java.util.Map map)
                           throws java.sql.SQLException
Specified by:
getObject in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getRef

public java.sql.Ref getRef(java.lang.String colName)
                    throws java.sql.SQLException
Specified by:
getRef in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getBlob

public java.sql.Blob getBlob(java.lang.String colName)
                      throws java.sql.SQLException
Specified by:
getBlob in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getClob

public java.sql.Clob getClob(java.lang.String colName)
                      throws java.sql.SQLException
Specified by:
getClob in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getArray

public java.sql.Array getArray(java.lang.String colName)
                        throws java.sql.SQLException
Specified by:
getArray in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getDate

public java.sql.Date getDate(int columnIndex,
                             java.util.Calendar cal)
                      throws java.sql.SQLException
Specified by:
getDate in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getDate

public java.sql.Date getDate(java.lang.String columnName,
                             java.util.Calendar cal)
                      throws java.sql.SQLException
Specified by:
getDate in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getTime

public java.sql.Time getTime(int columnIndex,
                             java.util.Calendar cal)
                      throws java.sql.SQLException
Specified by:
getTime in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getTime

public java.sql.Time getTime(java.lang.String columnName,
                             java.util.Calendar cal)
                      throws java.sql.SQLException
Specified by:
getTime in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getTimestamp

public java.sql.Timestamp getTimestamp(int columnIndex,
                                       java.util.Calendar cal)
                                throws java.sql.SQLException
Specified by:
getTimestamp in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String columnName,
                                       java.util.Calendar cal)
                                throws java.sql.SQLException
Specified by:
getTimestamp in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Retrieves the 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.

Specified by:
getConnection in interface javax.sql.RowSetInternal
Returns:
the Connection object passed to this rowset; may be null if there is no connection
Throws:
java.sql.SQLException - if an error occurs

setMetaData

public void setMetaData(javax.sql.RowSetMetaData md)
                 throws java.sql.SQLException
Description copied from interface: CachedRowSet
Sets the metadata for this 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.

Specified by:
setMetaData in interface CachedRowSet
Parameters:
md - a RowSetMetaData object containing metadata about the columns in this CachedRowSet object
Throws:
java.sql.SQLException - if invalid metadata is supplied to the rowset

getOriginal

public java.sql.ResultSet getOriginal()
                               throws java.sql.SQLException
Description copied from interface: CachedRowSet
Returns a 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.

Specified by:
getOriginal in interface CachedRowSet
Returns:
a ResultSet object that contains the original value for this CachedRowSet object
Throws:
java.sql.SQLException - if an error occurs producing the ResultSet object

getOriginalRow

public java.sql.ResultSet getOriginalRow()
                                  throws java.sql.SQLException
Description copied from interface: CachedRowSet
Returns a 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:

Specified by:
getOriginalRow in interface CachedRowSet
Returns:
the original result set of the row
Throws:
java.sql.SQLException - if there is no current row
See Also:
CachedRowSet.setOriginalRow()

setOriginalRow

public void setOriginalRow()
                    throws java.sql.SQLException
Description copied from interface: CachedRowSet
Sets the current row in this 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.

Specified by:
setOriginalRow in interface CachedRowSet
Throws:
java.sql.SQLException - if there is no current row or an error is encountered resetting the contents of the original row
See Also:
CachedRowSet.getOriginalRow()

setOriginal

public void setOriginal()
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getTableName

public java.lang.String getTableName()
                              throws java.sql.SQLException
Description copied from interface: CachedRowSet
Returns an identifier for the object (table) that was used to create this 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.

Specified by:
getTableName in interface CachedRowSet
Returns:
a 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
Throws:
java.sql.SQLException - if an error is encountered returning the table name
See Also:
ResultSetMetaData.getTableName(int)

setTableName

public void setTableName(java.lang.String tabName)
                  throws java.sql.SQLException
Description copied from interface: CachedRowSet
Sets the identifier for the table from which this 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.

Specified by:
setTableName in interface CachedRowSet
Parameters:
tabName - a String object identifying the table from which this CachedRowSet object was derived; cannot be null but may be an empty string
Throws:
java.sql.SQLException - if an error is encountered naming the table or tabName is null
See Also:
RowSetMetaData.setTableName(int, java.lang.String), RowSetWriter, SyncProvider

getKeyColumns

public int[] getKeyColumns()
                    throws java.sql.SQLException
Description copied from interface: CachedRowSet
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.

Specified by:
getKeyColumns in interface CachedRowSet
Returns:
an array containing the column number or numbers that indicate which columns constitute a primary key for a row in this CachedRowSet object. This array should be empty if no columns are representative of a primary key.
Throws:
java.sql.SQLException - if this CachedRowSet object is empty
See Also:
CachedRowSet.setKeyColumns(int[]), Joinable.getMatchColumnIndexes(), Joinable.getMatchColumnNames()

setKeyColumns

public void setKeyColumns(int[] keys)
                   throws java.sql.SQLException
Description copied from interface: CachedRowSet
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.

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.

Specified by:
setKeyColumns in interface CachedRowSet
Parameters:
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
Throws:
java.sql.SQLException - if any of the numbers in the given array are not valid for this rowset
See Also:
CachedRowSet.getKeyColumns(), Joinable.setMatchColumn(String), Joinable.setMatchColumn(int)

updateRef

public void updateRef(int columnIndex,
                      java.sql.Ref ref)
               throws java.sql.SQLException
Specified by:
updateRef in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateRef

public void updateRef(java.lang.String columnName,
                      java.sql.Ref ref)
               throws java.sql.SQLException
Specified by:
updateRef in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateClob

public void updateClob(int columnIndex,
                       java.sql.Clob c)
                throws java.sql.SQLException
Specified by:
updateClob in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateClob

public void updateClob(java.lang.String columnName,
                       java.sql.Clob c)
                throws java.sql.SQLException
Specified by:
updateClob in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(int columnIndex,
                       java.sql.Blob b)
                throws java.sql.SQLException
Specified by:
updateBlob in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(java.lang.String columnName,
                       java.sql.Blob b)
                throws java.sql.SQLException
Specified by:
updateBlob in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateArray

public void updateArray(int columnIndex,
                        java.sql.Array a)
                 throws java.sql.SQLException
Specified by:
updateArray in interface java.sql.ResultSet
Throws:
java.sql.SQLException

updateArray

public void updateArray(java.lang.String columnName,
                        java.sql.Array a)
                 throws java.sql.SQLException
Specified by:
updateArray in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getURL

public java.net.URL getURL(int columnIndex)
                    throws java.sql.SQLException
Specified by:
getURL in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getURL

public java.net.URL getURL(java.lang.String columnName)
                    throws java.sql.SQLException
Specified by:
getURL in interface java.sql.ResultSet
Throws:
java.sql.SQLException

getRowSetWarnings

public RowSetWarning getRowSetWarnings()
Description copied from interface: CachedRowSet
Retrieves the first warning reported by calls on this 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.

Specified by:
getRowSetWarnings in interface CachedRowSet
Returns:
RowSetWarning the first RowSetWarning object reported or null if there are none
See Also:
RowSetWarning

commit

public void commit()
            throws java.sql.SQLException
Description copied from interface: CachedRowSet
Each 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.

Specified by:
commit in interface CachedRowSet
Throws:
java.sql.SQLException - if a database access error occurs or this Connection object within this CachedRowSet is in auto-commit mode
See Also:
Connection.setAutoCommit(boolean)

rollback

public void rollback()
              throws java.sql.SQLException
Description copied from interface: CachedRowSet
Each 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.

Specified by:
rollback in interface CachedRowSet
Throws:
java.sql.SQLException - if a database access error occurs or this Connection object within this CachedRowSet is in auto-commit mode.

rollback

public void rollback(java.sql.Savepoint s)
              throws java.sql.SQLException
Description copied from interface: CachedRowSet
Each 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.

Specified by:
rollback in interface CachedRowSet
Parameters:
s - A Savepoint transaction marker
Throws:
java.sql.SQLException - if a database access error occurs or this Connection object within this CachedRowSet is in auto-commit mode.

unsetMatchColumn

public void unsetMatchColumn(int[] columnIdxes)
                      throws java.sql.SQLException
Description copied from interface: Joinable
Unsets the designated columns as the match column for this RowSet object.

Specified by:
unsetMatchColumn in interface Joinable
Parameters:
columnIdxes - an arrary of int that identifies the indexes of the column that are to be unset as a match column
Throws:
java.sql.SQLException - if an invalid column index is designated or if the designated column was not previously set as a match column
See Also:
Joinable.setMatchColumn(int)

unsetMatchColumn

public void unsetMatchColumn(java.lang.String[] columnIdxes)
                      throws java.sql.SQLException
Description copied from interface: Joinable
Unsets the designated columns as the match column for this RowSet object.

Specified by:
unsetMatchColumn in interface Joinable
Parameters:
columnIdxes - a array String objects giving the name of the columns that are to be unset as a match columns
Throws:
java.sql.SQLException - if an invalid column name is designated or the designated column was not previously set as a match column
See Also:
Joinable.setMatchColumn(int)

getMatchColumnNames

public java.lang.String[] getMatchColumnNames()
                                       throws java.sql.SQLException
Description copied from interface: Joinable
Retrieves the name of the match column that was set for this RowSet object with the method setMatchColumn(String columnName).

Specified by:
getMatchColumnNames in interface Joinable
Returns:
columnName the String object giving the name of the column set as the match column for this RowSet object
Throws:
java.sql.SQLException - if no match column has been set
See Also:
Joinable.setMatchColumn(int), Joinable.unsetMatchColumn(int)

getMatchColumnIndexes

public int[] getMatchColumnIndexes()
                            throws java.sql.SQLException
Description copied from interface: Joinable
Retrieves the index of the match column that was set for this RowSet object with the method setMatchColumn(int columnIdx).

Specified by:
getMatchColumnIndexes in interface Joinable
Returns:
an int identifying the index of the column that was set as the match column for this RowSet object
Throws:
java.sql.SQLException - if no match column has been set
See Also:
Joinable.setMatchColumn(int), Joinable.unsetMatchColumn(int)

setMatchColumn

public void setMatchColumn(int[] columnIdxes)
                    throws java.sql.SQLException
Description copied from interface: Joinable
Sets the designated columns as the match column for this RowSet object. A JoinRowSet object can now add this RowSet object based on the match column.

Specified by:
setMatchColumn in interface Joinable
Parameters:
columnIdxes - an array of int identifying the indexes of the columns to be set as the match columns
Throws:
java.sql.SQLException - if an invalid column index is set
See Also:
Joinable.setMatchColumn(int[]), Joinable.unsetMatchColumn(int[])

setMatchColumn

public void setMatchColumn(java.lang.String[] columnNames)
                    throws java.sql.SQLException
Description copied from interface: Joinable
Sets the designated columns as the match column for this RowSet object. A JoinRowSet object can now add this RowSet object based on the match column.

Specified by:
setMatchColumn in interface Joinable
Parameters:
columnNames - an array of String objects giving the names of the column to be set as the match columns
Throws:
java.sql.SQLException - if in invalid column name is set; if the column name is a null or an empty string
See Also:
Joinable.unsetMatchColumn(int), Joinable.setMatchColumn(int[])

setMatchColumn

public void setMatchColumn(int columnIdx)
                    throws java.sql.SQLException
Description copied from interface: Joinable
Sets the designated column as the match column for this RowSet object. A JoinRowSet object can now add this RowSet object based on the match column.

Sub-interfaces such as the CachedRowSetTM 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.

Specified by:
setMatchColumn in interface Joinable
Parameters:
columnIdx - an int identifying the index of the column to be set as the match column
Throws:
java.sql.SQLException - if an invalid column index is set
See Also:
Joinable.setMatchColumn(int[]), Joinable.unsetMatchColumn(int)

setMatchColumn

public void setMatchColumn(java.lang.String columnName)
                    throws java.sql.SQLException
Description copied from interface: Joinable
Sets the designated column as the match column for this 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.

Specified by:
setMatchColumn in interface Joinable
Parameters:
columnName - a String object giving the name of the column to be set as the match column
Throws:
java.sql.SQLException - if in invalid column name is set; if the column name is a null or an empty string
See Also:
Joinable.unsetMatchColumn(int), Joinable.setMatchColumn(int[])

unsetMatchColumn

public void unsetMatchColumn(int columnIdx)
                      throws java.sql.SQLException
Description copied from interface: Joinable
Unsets the designated column as the match column for this 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.

Specified by:
unsetMatchColumn in interface Joinable
Parameters:
columnIdx - an int that identifies the index of the column that is to be unset as a match column
Throws:
java.sql.SQLException - if an invalid column index is designated or if the designated column was not previously set as a match column
See Also:
Joinable.setMatchColumn(int)

unsetMatchColumn

public void unsetMatchColumn(java.lang.String columnName)
                      throws java.sql.SQLException
Description copied from interface: Joinable
Unsets the designated column as the match column for this 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.

Specified by:
unsetMatchColumn in interface Joinable
Parameters:
columnName - a String object giving the name of the column that is to be unset as a match column
Throws:
java.sql.SQLException - if an invalid column name is designated or the designated column was not previously set as a match column
See Also:
Joinable.setMatchColumn(int)

rowSetPopulated

public void rowSetPopulated(javax.sql.RowSetEvent event,
                            int numRows)
                     throws java.sql.SQLException
Description copied from interface: CachedRowSet
Notifies registered listeners that a RowSet object in the given RowSetEvent object has populated a number of additional rows. The 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.

Specified by:
rowSetPopulated in interface CachedRowSet
Parameters:
event - a RowSetEvent object that contains the RowSet object that is the source of the events
numRows - 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
Throws:
java.sql.SQLException

populate

public void populate(java.sql.ResultSet data,
                     int start)
              throws java.sql.SQLException
Description copied from interface: CachedRowSet
Populates this 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.

Specified by:
populate in interface CachedRowSet
Parameters:
start - the
data - the ResultSet object containing the data to be read into this CachedRowSet object
Throws:
java.sql.SQLException - if a null ResultSet object is supplied or this CachedRowSet object cannot retrieve the associated ResultSetMetaData object
See Also:
CachedRowSet.execute(java.sql.Connection), CachedRowSet.populate(ResultSet), ResultSet, ResultSetMetaData

nextPage

public boolean nextPage()
                 throws java.sql.SQLException
Description copied from interface: CachedRowSet
Increments the current page of the 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.

Specified by:
nextPage in interface CachedRowSet
Returns:
true if more pages exist; false if this is the last page
Throws:
java.sql.SQLException - if an error occurs fetching the next page, or if this method is called prematurely before populate or execute.

setPageSize

public void setPageSize(int size)
                 throws java.sql.SQLException
Description copied from interface: CachedRowSet
Sets the 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.

Specified by:
setPageSize in interface CachedRowSet
Parameters:
size - the page-size of the CachedRowSet
Throws:
java.sql.SQLException

getPageSize

public int getPageSize()
Description copied from interface: CachedRowSet
Returns the page-size for the CachedRowSet object

Specified by:
getPageSize in interface CachedRowSet
Returns:
an int page size

previousPage

public boolean previousPage()
                     throws java.sql.SQLException
Description copied from interface: CachedRowSet
Decrements the current page of the 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.

Specified by:
previousPage in interface CachedRowSet
Returns:
true if the previous page is successfully retrieved; false if this is the first page.
Throws:
java.sql.SQLException - if an error occurs fetching the previous page, or if this method is called prematurely before populate or execute.

getCatalogName

public java.lang.String getCatalogName()
Returns the catalog in which the table referred to by the tableName property resides.

Specified by:
getCatalogName in interface CachedRowSetX
Returns:
a 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.

See Also:
ResultSetMetaData.getCatalogName(int)

setCatalogName

public 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 CachedRowSetX object may obtain the the name internally from the RowSetMetaDataXImpl object.

Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter.

Specified by:
setCatalogName in interface CachedRowSetX
Parameters:
catalogName - a String object identifying the catalog of the table from which this CachedRowSetX object was derived; can be null or an empty String
See Also:
RowSetMetaData.setCatalogName(int, java.lang.String), RowSetWriter, javax.sql.rowset.spi.SyncProviderX

getSchemaName

public java.lang.String getSchemaName()
Returns the schema in which the table referred to by the tableName property resides.

Specified by:
getSchemaName in interface CachedRowSetX
Returns:
a 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.

See Also:
ResultSetMetaData.getCatalogName(int)

setSchemaName

public 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 CachedRowSetX object may obtain the the name internally from the RowSetMetaDataXImpl object.

Specified by:
setSchemaName in interface CachedRowSetX
Parameters:
schemaName - a String object identifying the schema of the table from which this CachedRowSetX object was derived; can be null or an empty String
See Also:
RowSetMetaData.setSchemaName(int, java.lang.String), RowSetWriter, javax.sql.rowset.spi.SyncProviderX

getColumnCatalogNames

public 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 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

getColumnCatalogNames

public 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.

Specified by:
getColumnCatalogNames in interface CachedRowSetX
Returns:
a String object or null

setColumnCatalogNames

public void setColumnCatalogNames(java.lang.String[] columnCatalogNames)
Set the columnCatalogNames property.

Specified by:
setColumnCatalogNames in interface CachedRowSetX
Parameters:
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.


setColumnCatalogNames

public void setColumnCatalogNames(int index,
                                  java.lang.String columnCatalogName)
Set the columnCatalogNames property.

Specified by:
setColumnCatalogNames in interface CachedRowSetX
Parameters:
index - the index of the array to set (zero based)
columnCatalogName - the name of catalog for the column (can also be null

getColumnSchemaNames

public 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 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

getColumnSchemaNames

public 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.

Specified by:
getColumnSchemaNames in interface CachedRowSetX
Returns:
a String object or null

setColumnSchemaNames

public void setColumnSchemaNames(java.lang.String[] columnSchemaNames)
Set the columnSchemaNames property.

Specified by:
setColumnSchemaNames in interface CachedRowSetX
Parameters:
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.


setColumnSchemaNames

public void setColumnSchemaNames(int index,
                                 java.lang.String columnSchemaName)
Set the columnSchemaNames property.

Specified by:
setColumnSchemaNames in interface CachedRowSetX
Parameters:
index - the index of the array to set (zero based)
columnSchemaName - the name of schema for the column (can also be null

getColumnTableNames

public 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 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

getColumnTableNames

public 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.

Specified by:
getColumnTableNames in interface CachedRowSetX
Returns:
a String object or null

setColumnTableNames

public void setColumnTableNames(java.lang.String[] columnTableNames)
Set the columnTableNames property.

Specified by:
setColumnTableNames in interface CachedRowSetX
Parameters:
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.


setColumnTableNames

public void setColumnTableNames(int index,
                                java.lang.String columnTableName)
Set the columnTableNames property.

Specified by:
setColumnTableNames in interface CachedRowSetX
Parameters:
index - the index of the array to set (zero based)
columnTableName - the name of table for the column (can also be null

getColumnNames

public 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 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

getColumnNames

public 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.

Specified by:
getColumnNames in interface CachedRowSetX
Returns:
a String object or null

setColumnNames

public void setColumnNames(java.lang.String[] columnNames)
Set the columnNames property.

Specified by:
setColumnNames in interface CachedRowSetX
Parameters:
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.


setColumnNames

public void setColumnNames(int index,
                           java.lang.String columnName)
Set the columnNames property.

Specified by:
setColumnNames in interface CachedRowSetX
Parameters:
index - the index of the array to set (zero based)
columnName - for the column (can also be null

getInsertableColumns

public boolean[] getInsertableColumns()
Returns an array of 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

getInsertableColumns

public boolean getInsertableColumns(int index)
Returns a 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

setInsertableColumns

public void setInsertableColumns(boolean[] insertableColumns)
Set the insertableColumns property.

Specified by:
setInsertableColumns in interface CachedRowSetX
Parameters:
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.


setInsertableColumns

public void setInsertableColumns(int index,
                                 boolean insertableColumn)
Set the insertableColumns property.

Specified by:
setInsertableColumns in interface CachedRowSetX
Parameters:
index - the index of the array to set (zero based)
insertableColumn - true if column should be inserted for new rows

getUpdatableColumns

public boolean[] getUpdatableColumns()
Returns an array of 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

getUpdatableColumns

public boolean getUpdatableColumns(int index)
Returns a 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

setUpdatableColumns

public void setUpdatableColumns(boolean[] updatableColumns)
Set the updatableColumns property.

Specified by:
setUpdatableColumns in interface CachedRowSetX
Parameters:
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.


setUpdatableColumns

public void setUpdatableColumns(int index,
                                boolean updatableColumn)
Set the updatableColumns property.

Specified by:
setUpdatableColumns in interface CachedRowSetX
Parameters:
index - the index of the array to set (zero based)
updatableColumn - true if column should be updated when rows are updated

getPrintStatements

public boolean getPrintStatements()
Returns the printStatements property.

Specified by:
getPrintStatements in interface CachedRowSetX
Returns:
a 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.


setPrintStatements

public 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.

Specified by:
setPrintStatements in interface CachedRowSetX
Parameters:
printStatements - a boolean{/code> object which determines whether SQL Insert, UPDATE and DELETE statements are written to System.out