com.sun.rowset
Class WebRowSetImpl

java.lang.Object
  extended byjavax.sql.rowset.BaseRowSet
      extended bycom.sun.rowset.CachedRowSetImpl
          extended bycom.sun.rowset.WebRowSetImpl
All Implemented Interfaces:
CachedRowSet, java.lang.Cloneable, Joinable, java.sql.ResultSet, javax.sql.RowSet, javax.sql.RowSetInternal, java.io.Serializable, WebRowSet
Direct Known Subclasses:
FilteredRowSetImpl, JoinRowSetImpl

public class WebRowSetImpl
extends CachedRowSetImpl
implements WebRowSet

The standard implementation of the WebRowSet interface. See the interface defintion for full behaviour and implementation requirements.

Author:
Jonathan Bruce, Amit Handa
See Also:
Serialized Form

Field Summary
 
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.WebRowSet
PUBLIC_XML_SCHEMA, SCHEMA_SYSTEM_ID
 
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
WebRowSetImpl()
          Constructs a new WebRowSet object initialized with the default values for a CachedRowSet object instance.
WebRowSetImpl(java.util.Hashtable env)
          Constructs a new WebRowSet object initialized with the the synchronization SPI provider properties as specified in the Hashtable.
 
Method Summary
 void readXml(java.io.InputStream iStream)
          Reads a stream based XML input to populate this WebRowSet object.
 void readXml(java.io.Reader reader)
          Reads this WebRowSet object in its XML format.
 void writeXml(java.io.OutputStream oStream)
          Writes this WebRowSet object to the given OutputStream object in XML format.
 void writeXml(java.sql.ResultSet rs, java.io.OutputStream oStream)
          Populates this WebRowSet object with the data in the given ResultSet object and writes itself to the given java.io.OutputStream object in XML format.
 void writeXml(java.sql.ResultSet rs, java.io.Writer writer)
          Populates this WebRowSet object with the data in the given ResultSet object and writes itself to the given java.io.Writer object in XML format.
 void writeXml(java.io.Writer writer)
          Writes this WebRowSet object to the given java.io.Writer object in XML format.
 
Methods inherited from class com.sun.rowset.CachedRowSetImpl
absolute, acceptChanges, acceptChanges, 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, getCharacterStream, getCharacterStream, getClob, getClob, getConnection, getCurrentRow, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getKeyColumns, getLong, getLong, getMatchColumnIndexes, getMatchColumnNames, getMetaData, getObject, getObject, getObject, getObject, getOriginal, getOriginalRow, getPageSize, getRef, getRef, getRow, getRowSetWarnings, getShort, getShort, getStatement, getString, getString, getSyncProvider, getTableName, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, internalFirst, internalLast, internalNext, internalPrevious, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, nextPage, populate, populate, previous, previousPage, refreshRow, relative, release, removeCurrentRow, restoreOriginal, rollback, rollback, rowDeleted, rowInserted, rowSetPopulated, rowUpdated, setCommand, setKeyColumns, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, setMetaData, setOriginal, setOriginalRow, setPageSize, setSyncProvider, setTableName, 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 javax.sql.rowset.BaseRowSet
addRowSetListener, clearParameters, getCommand, getConcurrency, getDataSourceName, getEscapeProcessing, getFetchDirection, getFetchSize, getMaxFieldSize, getMaxRows, getParams, getPassword, getQueryTimeout, getShowDeleted, getTransactionIsolation, getType, getTypeMap, getUrl, getUsername, initParams, isReadOnly, notifyCursorMoved, notifyRowChanged, notifyRowSetChanged, removeRowSetListener, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setConcurrency, setDataSourceName, setDate, setDate, setDouble, setEscapeProcessing, setFetchDirection, setFetchSize, setFloat, setInt, setLong, setMaxFieldSize, setMaxRows, setNull, setNull, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setRef, setShort, setShowDeleted, setString, setTime, setTime, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setUrl, setUsername
 
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
acceptChanges, acceptChanges, columnUpdated, columnUpdated, commit, createCopy, createCopyNoConstraints, createCopySchema, createShared, execute, getKeyColumns, getOriginal, getOriginalRow, getPageSize, getRowSetWarnings, getShowDeleted, getSyncProvider, getTableName, nextPage, populate, populate, previousPage, release, restoreOriginal, rollback, rollback, rowSetPopulated, setKeyColumns, setMetaData, setOriginalRow, setPageSize, setShowDeleted, setSyncProvider, setTableName, size, toCollection, toCollection, toCollection, undoDelete, undoInsert, undoUpdate
 
Methods inherited from interface javax.sql.RowSet
addRowSetListener, clearParameters, execute, getCommand, getDataSourceName, getEscapeProcessing, getMaxFieldSize, getMaxRows, getPassword, getQueryTimeout, getTransactionIsolation, getTypeMap, getUrl, getUsername, isReadOnly, removeRowSetListener, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setCommand, setConcurrency, setDataSourceName, setDate, setDate, setDouble, setEscapeProcessing, setFloat, setInt, setLong, setMaxFieldSize, setMaxRows, setNull, setNull, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setUrl, setUsername
 
Methods inherited from interface java.sql.ResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getInt, getLong, getLong, getMetaData, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getShort, getShort, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, 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 interface javax.sql.rowset.Joinable
getMatchColumnIndexes, getMatchColumnNames, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn
 
Methods inherited from interface javax.sql.RowSetInternal
getParams
 

Constructor Detail

WebRowSetImpl

public WebRowSetImpl()
              throws java.sql.SQLException
Constructs a new WebRowSet object initialized with the default values for a CachedRowSet object instance. This provides the RIOptimistic provider to deliver synchronization capabilities to relational datastores and a default WebRowSetXmlReader object and a default WebRowSetXmlWriter object to enable XML output capabilities.

Throws:
java.sql.SQLException - if an error occurs in configuring the default synchronization providers for relational and XML providers.

WebRowSetImpl

public WebRowSetImpl(java.util.Hashtable env)
              throws java.sql.SQLException
Constructs a new WebRowSet object initialized with the the synchronization SPI provider properties as specified in the Hashtable. If this hashtable is empty or is null the default constructor is invoked.

Throws:
java.sql.SQLException - if an error occurs in configuring the specified synchronization providers for the relational and XML providers; or if the Hashtanle is null
Method Detail

writeXml

public void writeXml(java.sql.ResultSet rs,
                     java.io.Writer writer)
              throws java.sql.SQLException
Populates this WebRowSet object with the data in the given ResultSet object and writes itself to the given java.io.Writer object in XML format. This includes the rowset's data, properties, and metadata.

Specified by:
writeXml in interface WebRowSet
Parameters:
rs - the ResultSet object with which to populate this WebRowSet object
writer - the java.io.Writer object to write to.
Throws:
java.sql.SQLException - if an error occurs writing out the rowset contents to XML

writeXml

public void writeXml(java.io.Writer writer)
              throws java.sql.SQLException
Writes this WebRowSet object to the given java.io.Writer object in XML format. This includes the rowset's data, properties, and metadata.

Specified by:
writeXml in interface WebRowSet
Parameters:
writer - the java.io.Writer stream to write to
Throws:
java.sql.SQLException - if an error occurs writing out the rowset contents to XML

readXml

public void readXml(java.io.Reader reader)
             throws java.sql.SQLException
Reads this WebRowSet object in its XML format.

Specified by:
readXml in interface WebRowSet
Parameters:
reader - the java.io.Reader stream from which this WebRowSet object will be populated
Throws:
java.sql.SQLException - if a database access error occurs

readXml

public void readXml(java.io.InputStream iStream)
             throws java.sql.SQLException,
                    java.io.IOException
Reads a stream based XML input to populate this WebRowSet object.

Specified by:
readXml in interface WebRowSet
Parameters:
iStream - the java.io.InputStream from which this WebRowSet object will be populated
Throws:
java.sql.SQLException - if a data source access error occurs
java.io.IOException - if a IO exception occurs

writeXml

public void writeXml(java.io.OutputStream oStream)
              throws java.sql.SQLException,
                     java.io.IOException
Writes this WebRowSet object to the given OutputStream object in XML format. Creates an an output stream of the internal state and contents of a WebRowSet for XML proceessing

Specified by:
writeXml in interface WebRowSet
Parameters:
oStream - the java.io.OutputStream stream to write to
Throws:
java.sql.SQLException - if a datasource access error occurs
java.io.IOException - if an IO exception occurs

writeXml

public void writeXml(java.sql.ResultSet rs,
                     java.io.OutputStream oStream)
              throws java.sql.SQLException,
                     java.io.IOException
Populates this WebRowSet object with the data in the given ResultSet object and writes itself to the given java.io.OutputStream object in XML format. This includes the rowset's data, properties, and metadata.

Specified by:
writeXml in interface WebRowSet
Parameters:
rs - the ResultSet object with which to populate this WebRowSet object
oStream - the java.io.OutputStream to write to
Throws:
java.sql.SQLException - if a datasource access error occurs
java.io.IOException - if an IO exception occurs