com.sun.sql.rowset
Class CachedRowSetXImpl

java.lang.Object
  extended by javax.sql.rowset.BaseRowSet
      extended by com.sun.sql.rowset.BaseRowSetX
          extended by com.sun.sql.rowset.CachedRowSetXImpl5
              extended by com.sun.sql.rowset.CachedRowSetXImpl
All Implemented Interfaces:
CachedRowSetX, java.io.Serializable, java.lang.Cloneable, java.sql.ResultSet, javax.sql.RowSet, javax.sql.rowset.CachedRowSet, javax.sql.rowset.Joinable, javax.sql.RowSetInternal
Direct Known Subclasses:
SyncResolverXImpl

public class CachedRowSetXImpl
extends CachedRowSetXImpl5

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
 
Fields inherited from class com.sun.sql.rowset.CachedRowSetXImpl5
cursorPos, internalUseInstance, numDeleted, numRows, propertyChangeSupport, provider, rb, rowSetMD, rowSetReader, rowsetWarning, rowSetWriter, rvh, sqlwarn
 
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
static CachedRowSetXImpl createInternalUseInstance()
           
 int getHoldability()
           
 java.io.Reader getNCharacterStream(int arg0)
           
 java.io.Reader getNCharacterStream(java.lang.String arg0)
           
 java.sql.NClob getNClob(int arg0)
           
 java.sql.NClob getNClob(java.lang.String arg0)
           
 java.lang.String getNString(int arg0)
           
 java.lang.String getNString(java.lang.String arg0)
           
 java.sql.ResultSet getOriginal()
           
 java.sql.ResultSet getOriginalRow()
           
 java.sql.RowId getRowId(int arg0)
           
 java.sql.RowId getRowId(java.lang.String arg0)
           
 java.sql.SQLXML getSQLXML(int arg0)
           
 java.sql.SQLXML getSQLXML(java.lang.String arg0)
           
 boolean isClosed()
           
 boolean isWrapperFor(java.lang.Class arg0)
           
 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.

 java.lang.Object unwrap(java.lang.Class arg0)
           
 void updateAsciiStream(int arg0, java.io.InputStream arg1)
           
 void updateAsciiStream(int arg0, java.io.InputStream arg1, long arg2)
           
 void updateAsciiStream(java.lang.String arg0, java.io.InputStream arg1)
           
 void updateAsciiStream(java.lang.String arg0, java.io.InputStream arg1, long arg2)
           
 void updateBinaryStream(int arg0, java.io.InputStream arg1)
           
 void updateBinaryStream(int arg0, java.io.InputStream arg1, long arg2)
           
 void updateBinaryStream(java.lang.String arg0, java.io.InputStream arg1)
           
 void updateBinaryStream(java.lang.String arg0, java.io.InputStream arg1, long arg2)
           
 void updateBlob(int arg0, java.io.InputStream arg1)
           
 void updateBlob(int arg0, java.io.InputStream arg1, long arg2)
           
 void updateBlob(java.lang.String arg0, java.io.InputStream arg1)
           
 void updateBlob(java.lang.String arg0, java.io.InputStream arg1, long arg2)
           
 void updateCharacterStream(int arg0, java.io.Reader arg1)
           
 void updateCharacterStream(int arg0, java.io.Reader arg1, long arg2)
           
 void updateCharacterStream(java.lang.String arg0, java.io.Reader arg1)
           
 void updateCharacterStream(java.lang.String arg0, java.io.Reader arg1, long arg2)
           
 void updateClob(int arg0, java.io.Reader arg1)
           
 void updateClob(int arg0, java.io.Reader arg1, long arg2)
           
 void updateClob(java.lang.String arg0, java.io.Reader arg1)
           
 void updateClob(java.lang.String arg0, java.io.Reader arg1, long arg2)
           
 void updateNCharacterStream(int arg0, java.io.Reader arg1)
           
 void updateNCharacterStream(int arg0, java.io.Reader arg1, long arg2)
           
 void updateNCharacterStream(java.lang.String arg0, java.io.Reader arg1)
           
 void updateNCharacterStream(java.lang.String arg0, java.io.Reader arg1, long arg2)
           
 void updateNClob(int arg0, java.sql.NClob arg1)
           
 void updateNClob(int arg0, java.io.Reader arg1)
           
 void updateNClob(int arg0, java.io.Reader arg1, long arg2)
           
 void updateNClob(java.lang.String arg0, java.sql.NClob arg1)
           
 void updateNClob(java.lang.String arg0, java.io.Reader arg1)
           
 void updateNClob(java.lang.String arg0, java.io.Reader arg1, long arg2)
           
 void updateNString(int arg0, java.lang.String arg1)
           
 void updateNString(java.lang.String arg0, java.lang.String arg1)
           
 void updateRowId(int arg0, java.sql.RowId arg1)
           
 void updateRowId(java.lang.String arg0, java.sql.RowId arg1)
           
 void updateSQLXML(int arg0, java.sql.SQLXML arg1)
           
 void updateSQLXML(java.lang.String arg0, java.sql.SQLXML arg1)
           
 
Methods inherited from class com.sun.sql.rowset.CachedRowSetXImpl5
absolute, acceptChanges, acceptChanges, addPropertyChangeListener, addPropertyChangeListener, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, clone, close, columnUpdated, columnUpdated, commit, createCopy, createCopyNoConstraints, createCopySchema, createShared, deleteRow, execute, execute, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCatalogName, getCharacterStream, getCharacterStream, getClob, getClob, getColumnCatalogNames, getColumnCatalogNames, getColumnNames, getColumnNames, getColumnSchemaNames, getColumnSchemaNames, getColumnTableNames, getColumnTableNames, getConnection, getCurrentRow, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInsertableColumns, getInsertableColumns, getInt, getInt, getKeyColumns, getLong, getLong, getMatchColumnIndexes, getMatchColumnNames, getMetaData, getObject, getObject, getObject, getObject, getPageSize, getPrintStatements, getRef, getRef, getRow, getRowSetWarnings, getSchemaName, getShort, getShort, getStatement, getString, getString, getSyncProvider, getTableName, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getUnicodeStream, getUnicodeStream, getUpdatableColumns, getUpdatableColumns, getURL, getURL, getWarnings, initContainer, initParams, initProperties, insertRow, internalFirst, internalLast, internalNext, internalPrevious, isAfterLast, isBeforeFirst, isExecuted, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, nextPage, populate, populate, previous, previousPage, refreshRow, relative, release, removeCurrentRow, removePropertyChangeListener, removePropertyChangeListener, restoreOriginal, rollback, rollback, rowDeleted, rowInserted, rowSetPopulated, rowUpdated, setCatalogName, setColumnCatalogNames, setColumnCatalogNames, setColumnNames, setColumnNames, setColumnSchemaNames, setColumnSchemaNames, setColumnTableNames, setColumnTableNames, setConcurrency, setDataSourceName, setInsertableColumns, setInsertableColumns, setKeyColumns, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, setMaxRows, setMetaData, setOriginal, setOriginalRow, setPageSize, setPassword, setPrintStatements, setReadOnly, setSchemaName, setSyncProvider, setTableName, setTransactionIsolation, setType, setUpdatableColumns, setUpdatableColumns, setUrl, setUsername, size, toCollection, toCollection, toCollection, undoDelete, undoInsert, undoUpdate, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, 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, setUnicodeStream
 
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
 

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

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 CachedRowSetXImpl5
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()

getOriginal

public java.sql.ResultSet getOriginal()
                               throws java.sql.SQLException
Specified by:
getOriginal in interface javax.sql.rowset.CachedRowSet
Specified by:
getOriginal in interface javax.sql.RowSetInternal
Specified by:
getOriginal in class CachedRowSetXImpl5
Throws:
java.sql.SQLException

getOriginalRow

public java.sql.ResultSet getOriginalRow()
                                  throws java.sql.SQLException
Specified by:
getOriginalRow in interface javax.sql.rowset.CachedRowSet
Specified by:
getOriginalRow in interface javax.sql.RowSetInternal
Specified by:
getOriginalRow in class CachedRowSetXImpl5
Throws:
java.sql.SQLException

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getNCharacterStream

public java.io.Reader getNCharacterStream(int arg0)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getNCharacterStream

public java.io.Reader getNCharacterStream(java.lang.String arg0)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getNClob

public java.sql.NClob getNClob(int arg0)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getNClob

public java.sql.NClob getNClob(java.lang.String arg0)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getNString

public java.lang.String getNString(int arg0)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

getNString

public java.lang.String getNString(java.lang.String arg0)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

getRowId

public java.sql.RowId getRowId(int arg0)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getRowId

public java.sql.RowId getRowId(java.lang.String arg0)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getSQLXML

public java.sql.SQLXML getSQLXML(int arg0)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getSQLXML

public java.sql.SQLXML getSQLXML(java.lang.String arg0)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(int arg0,
                              java.io.InputStream arg1,
                              long arg2)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(java.lang.String arg0,
                              java.io.InputStream arg1,
                              long arg2)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(int arg0,
                              java.io.InputStream arg1)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(java.lang.String arg0,
                              java.io.InputStream arg1)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(int arg0,
                               java.io.InputStream arg1,
                               long arg2)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(java.lang.String arg0,
                               java.io.InputStream arg1,
                               long arg2)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(int arg0,
                               java.io.InputStream arg1)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(java.lang.String arg0,
                               java.io.InputStream arg1)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(int arg0,
                       java.io.InputStream arg1,
                       long arg2)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(java.lang.String arg0,
                       java.io.InputStream arg1,
                       long arg2)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(int arg0,
                       java.io.InputStream arg1)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(java.lang.String arg0,
                       java.io.InputStream arg1)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(int arg0,
                                  java.io.Reader arg1,
                                  long arg2)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(java.lang.String arg0,
                                  java.io.Reader arg1,
                                  long arg2)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(int arg0,
                                  java.io.Reader arg1)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(java.lang.String arg0,
                                  java.io.Reader arg1)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

updateClob

public void updateClob(int arg0,
                       java.io.Reader arg1,
                       long arg2)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateClob

public void updateClob(java.lang.String arg0,
                       java.io.Reader arg1,
                       long arg2)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateClob

public void updateClob(int arg0,
                       java.io.Reader arg1)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateClob

public void updateClob(java.lang.String arg0,
                       java.io.Reader arg1)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNCharacterStream

public void updateNCharacterStream(int arg0,
                                   java.io.Reader arg1,
                                   long arg2)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNCharacterStream

public void updateNCharacterStream(java.lang.String arg0,
                                   java.io.Reader arg1,
                                   long arg2)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNCharacterStream

public void updateNCharacterStream(int arg0,
                                   java.io.Reader arg1)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNCharacterStream

public void updateNCharacterStream(java.lang.String arg0,
                                   java.io.Reader arg1)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(int arg0,
                        java.sql.NClob arg1)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(java.lang.String arg0,
                        java.sql.NClob arg1)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(int arg0,
                        java.io.Reader arg1,
                        long arg2)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(java.lang.String arg0,
                        java.io.Reader arg1,
                        long arg2)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(int arg0,
                        java.io.Reader arg1)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(java.lang.String arg0,
                        java.io.Reader arg1)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNString

public void updateNString(int arg0,
                          java.lang.String arg1)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNString

public void updateNString(java.lang.String arg0,
                          java.lang.String arg1)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

updateRowId

public void updateRowId(int arg0,
                        java.sql.RowId arg1)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateRowId

public void updateRowId(java.lang.String arg0,
                        java.sql.RowId arg1)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateSQLXML

public void updateSQLXML(int arg0,
                         java.sql.SQLXML arg1)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

updateSQLXML

public void updateSQLXML(java.lang.String arg0,
                         java.sql.SQLXML arg1)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class arg0)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

unwrap

public java.lang.Object unwrap(java.lang.Class arg0)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException