|
BEA Systems, Inc. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectweblogic.jdbc.rowset.BaseRowSet
weblogic.jdbc.rowset.CachedRowSetImpl
public class CachedRowSetImpl
CachedRowSet is an implementation of the JDBC RowSet API (javax.sql.RowSet). This implementation provides a disconnected RowSet. The CachedRowSet is populated with data from a JDBC query or an existing JDBC ResultSet. At this point, the RowSet has all of the data in memory. The CachedRowSet uses the familiar ResultSet methods for reading, inserting, updating, and deleteting data. These operations only change the current copy of the data in memory. The data is not written back to the database until the acceptChanges method is called. The CachedRowSet uses optimistic concurrency when data is written back to the database. By default, the SQL UPDATE statement verifies that the data in the database matches what was read into the CachedRowSet. It is possible to select other Optimistic policies with the setOptimisticPolicy method.
| Field Summary |
|---|
| Fields inherited from interface weblogic.jdbc.rowset.WLCachedRowSet |
|---|
ALL_ROWS, CHANGED_ALL, CHANGED_CURRENT, CHANGED_ORIGINAL, CURRENT_ALL, UNCHANGED_CURRENT |
| Fields inherited from interface javax.sql.rowset.spi.SyncResolver |
|---|
DELETE_ROW_CONFLICT, INSERT_ROW_CONFLICT, NO_ROW_CONFLICT, UPDATE_ROW_CONFLICT |
| Constructor Summary | |
|---|---|
CachedRowSetImpl()
Constructs a new default CachedRowSetImpl object with the capacity to hold 100 rows. |
|
CachedRowSetImpl(Hashtable env)
Provides a CachedRowSetImpl instance with the same default properties as the zero parameter constructor. |
|
| Method Summary | |
|---|---|
void |
acceptChanges()
Propagates all row update, insert, and delete changes to the underlying data source backing this CachedRowSetImpl object. |
void |
acceptChanges(Connection con)
Propagates all row update, insert, and delete changes to the data source backing this CachedRowSetImpl object using the given Connection object. |
void |
cancelRowUpdates()
Rolls back any updates made to the current row of this CachedRowSetImpl object and notifies listeners that a row has changed. |
protected Object |
clone()
Returns a new RowSet object containing by the same data as this CachedRowSetImpl object. |
void |
close()
Closes this CachedRowSetImpl objecy and releases any resources it was using. |
void |
commit()
Commits all changes performed by the acceptChanges() methods |
CachedRowSet |
createCopy()
Creates a RowSet object that is a deep copy of this CachedRowSetImpl object's data, including constraints. |
CachedRowSet |
createCopyNoConstraints()
Creates a CachedRowSet object that is a copy of this CachedRowSetImpl object's data only. |
CachedRowSet |
createCopySchema()
Creates a RowSet object that is a copy of this CachedRowSetImpl object's table structure and the constraints only. |
RowSet |
createShared()
Returns a new RowSet object backed by the same data as that of this CachedRowSetImpl object and sharing a set of cursors with it. |
void |
deleteRow()
Deletes the current row from this CachedRowSetImpl object and notifies listeners registered with this rowset that a row has changed. |
void |
execute()
Populates this CachedRowSetImpl object with data |
void |
execute(Connection con)
Populates this CachedRowSetImpl object with data, using the given connection to produce the result set from which data will be read. |
Map |
getCurrentRow()
Returns the insert row or the current row of this CachedRowSetImplobject. |
Predicate |
getFilter()
FilteredRowSetImpl - Retrieve the filter active for this FilteredRowSet |
ResultSet |
getOriginal()
Returns a result set containing the original value of the rowset. |
ResultSet |
getOriginalRow()
Returns a result set containing the original value of the current row only. |
int |
getPageSize()
This is the getter function for the size of the page. |
Map |
getRow(int index)
Returns the number of the current row in this CachedRowSetImpl object. |
void |
insertRow()
Inserts the contents of this CachedRowSetImpl object's insert row into this rowset immediately following the current row. |
boolean |
isWrapperFor(Class iface)
|
void |
moveToCurrentRow()
Moves the cursor for this CachedRowSetImpl object to the current row. |
void |
moveToInsertRow()
Moves the cursor for this CachedRowSetImpl object to the insert row. |
boolean |
nextPage()
The nextPage gets the next page, that is a CachedRowSetImpl object containing the number of rows specified by page size. |
void |
populate(ResultSet rs)
Populates this CachedRowSetImpl object with data from the given ResultSet object. |
void |
populate(ResultSet rs,
int i)
Populates this CachedRowSet object with data from the given ResultSet object. |
boolean |
previousPage()
Retrieves the data present in the page prior to the page from where it is called. |
void |
readXml(InputStream iStream)
|
void |
readXml(Reader reader)
|
void |
readXml(XMLInputStream xis)
|
void |
refreshRow()
Sets the current row with its original value and marks the row as not updated, thus undoing any changes made to the row since the last call to the methods updateRow or deleteRow. |
void |
release()
Releases the current contents of this CachedRowSetImpl object and sends a rowSetChanged event object to all registered listeners. |
void |
restoreOriginal()
Restores this CachedRowSetImpl object to its original state, that is, its state before the last set of changes. |
void |
rollback()
Rolls back all changes performed by the acceptChanges() methods |
void |
rollback(Savepoint s)
Rolls back all changes performed by the acceptChanges() to the last Savepoint transaction marker. |
void |
rowSetPopulated(RowSetEvent rse,
int i)
Notifies registered listeners that a RowSet object in the given RowSetEvent object has populated a number of additional rows. |
void |
setFilter(Predicate p)
FilteredRowSetImpl - Apply the predicate for this filter |
void |
setOriginalRow()
void setOriginalRow() - Marks the current row in this rowset as being an original row. |
void |
setPageSize(int i)
This is the setter function for setting the size of the page, which specifies how many rows have to be retrived at a time. |
void |
setSorter(Comparator s)
FilteredRowSetImpl - Apply the predicate for this filter |
int |
size()
Returns the number of rows in this CachedRowSetImpl object. |
Collection |
toCollection(int column)
|
void |
undoDelete()
void undoDelete() - Cancels deletion of the current row and notifies listeners that a row has changed. |
void |
undoInsert()
Immediately removes the current row from this CachedRowSetImpl object if the row has been inserted, and also notifies listeners the a row has changed. |
void |
undoUpdate()
Immediately reverses the last update operation if the row has been modified. |
Object |
unwrap(Class iface)
|
void |
updateRow()
Marks the current row of this CachedRowSetImpl object as updated and notifies listeners registered with this rowset that the row has changed. |
void |
writeXml(OutputStream oStream)
|
void |
writeXml(ResultSet rs,
OutputStream oStream)
|
void |
writeXml(ResultSet rs,
Writer writer)
|
void |
writeXml(Writer oWriter)
|
| Methods inherited from class weblogic.jdbc.rowset.BaseRowSet |
|---|
absolute, addRowSetListener, afterLast, beforeFirst, clearParameters, clearWarnings, columnUpdated, columnUpdated, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getCommand, getConcurrency, getConnection, getCursorName, getDataSource, getDataSourceName, getDate, getDate, getDate, getDate, getDouble, getDouble, getEscapeProcessing, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getKeyColumns, getLong, getLong, getMatchColumnIndexes, getMatchColumnNames, getMaxFieldSize, getMaxRows, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getParams, getPassword, getQueryTimeout, getRef, getRef, getRow, getRowId, getRowId, getRowSetWarnings, getShort, getShort, getShowDeleted, getSQLXML, getSQLXML, getStatement, getString, getString, getSyncProvider, getTableName, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getTransactionIsolation, getType, getTypeMap, getUnicodeStream, getUnicodeStream, getUrl, getURL, getURL, getUsername, getWarnings, isAfterLast, isBeforeFirst, isClosed, isComplete, isFirst, isLast, isReadOnly, last, next, previous, relative, removeRowSetListener, rowDeleted, rowInserted, rowUpdated, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBlob, setBlob, setBlob, setBoolean, setBoolean, setByte, setByte, setBytes, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setClob, setClob, setClob, setCommand, setConcurrency, setDataSource, setDataSourceName, setDate, setDate, setDate, setDate, setDouble, setDouble, setEscapeProcessing, setFetchDirection, setFetchSize, setFloat, setFloat, setInt, setInt, setIsComplete, setKeyColumns, setLong, setLong, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, setMaxFieldSize, setMaxRows, setMetaData, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNClob, setNClob, setNClob, setNString, setNString, setNull, setNull, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setReadOnlyInternal, setRef, setRowId, setRowId, setShort, setShort, setShowDeleted, setSQLXML, setSQLXML, setString, setString, setSyncProvider, setTableName, setTime, setTime, setTime, setTime, setTimestamp, setTimestamp, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setURL, setUrl, setUsername, setWriter, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface weblogic.jdbc.rowset.WLCachedRowSet |
|---|
executeAndGuessTableName, executeAndGuessTableNameAndPrimaryKeys, getDataSource, getRows, getRows, isComplete, loadXML, moveToUpdateRow, populate, setDataSource, setRowSetSynced, setRowSynced, writeXML, writeXML |
| Methods inherited from interface javax.sql.rowset.CachedRowSet |
|---|
columnUpdated, columnUpdated, getKeyColumns, getRowSetWarnings, getShowDeleted, getSyncProvider, getTableName, setKeyColumns, setMetaData, setShowDeleted, setSyncProvider, setTableName, toCollection, toCollection |
| Methods inherited from interface javax.sql.rowset.Joinable |
|---|
getMatchColumnIndexes, getMatchColumnNames, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn |
| Methods inherited from interface javax.sql.rowset.CachedRowSet |
|---|
columnUpdated, columnUpdated, getKeyColumns, getRowSetWarnings, getShowDeleted, getSyncProvider, getTableName, setKeyColumns, setMetaData, setShowDeleted, setSyncProvider, setTableName, toCollection, toCollection |
| Methods inherited from interface javax.sql.rowset.Joinable |
|---|
getMatchColumnIndexes, getMatchColumnNames, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn |
| Methods inherited from interface javax.sql.rowset.CachedRowSet |
|---|
columnUpdated, columnUpdated, getKeyColumns, getRowSetWarnings, getShowDeleted, getSyncProvider, getTableName, setKeyColumns, setMetaData, setShowDeleted, setSyncProvider, setTableName, toCollection, toCollection |
| Methods inherited from interface javax.sql.rowset.Joinable |
|---|
getMatchColumnIndexes, getMatchColumnNames, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn |
| Methods inherited from interface weblogic.jdbc.rowset.SortedRowSet |
|---|
getSorter |
| Methods inherited from interface javax.sql.rowset.spi.SyncResolver |
|---|
getConflictValue, getConflictValue, getStatus, nextConflict, previousConflict, setResolvedValue, setResolvedValue |
| Constructor Detail |
|---|
public CachedRowSetImpl()
public CachedRowSetImpl(Hashtable env)
| Method Detail |
|---|
public void populate(ResultSet rs)
throws SQLException
populate in interface CachedRowSetSQLException
public void populate(ResultSet rs,
int i)
throws SQLException
populate in interface CachedRowSetSQLException
public void execute()
throws SQLException
execute in interface RowSetSQLException
public void execute(Connection con)
throws SQLException
execute in interface CachedRowSetSQLException
public void acceptChanges()
throws SyncProviderException
acceptChanges in interface CachedRowSetSyncProviderException
public void acceptChanges(Connection con)
throws SyncProviderException
acceptChanges in interface CachedRowSetSyncProviderException
public void insertRow()
throws SQLException
insertRow in interface ResultSetSQLException
public void undoInsert()
throws SQLException
undoInsert in interface CachedRowSetSQLException
public void deleteRow()
throws SQLException
deleteRow in interface ResultSetSQLException
public void undoDelete()
throws SQLException
undoDelete in interface CachedRowSetSQLException
public void updateRow()
throws SQLException
updateRow in interface ResultSetSQLException
public void undoUpdate()
throws SQLException
undoUpdate in interface CachedRowSetSQLException
public void cancelRowUpdates()
throws SQLException
cancelRowUpdates in interface ResultSetSQLException
public void setOriginalRow()
throws SQLException
setOriginalRow in interface CachedRowSetSQLException
public void restoreOriginal()
throws SQLException
restoreOriginal in interface CachedRowSetSQLException
public ResultSet getOriginal()
throws SQLException
getOriginal in interface CachedRowSetSQLException
public ResultSet getOriginalRow()
throws SQLException
getOriginalRow in interface CachedRowSetSQLException
public void refreshRow()
throws SQLException
refreshRow in interface ResultSetSQLExceptionpublic void moveToInsertRow()
moveToInsertRow in interface ResultSetpublic void moveToCurrentRow()
moveToCurrentRow in interface ResultSetpublic void setFilter(Predicate p)
setFilter in interface FilteredRowSetpublic Predicate getFilter()
getFilter in interface FilteredRowSetpublic void setSorter(Comparator s)
setSorter in interface SortedRowSets - Comparator instance used to decide the order of rows.public int size()
size in interface CachedRowSetsize in class BaseRowSet
public Map getCurrentRow()
throws SQLException
getCurrentRow in interface WLCachedRowSetSQLException - if the current RowSet position is not a
valid row
public Map getRow(int index)
throws SQLException
getRow in interface WLCachedRowSetindex - row index into the row set. Valid values are [0 ...
row.size() -1]
SQLException - if the index is not a valid row
public Collection toCollection(int column)
throws SQLException
toCollection in interface CachedRowSetSQLException
public void readXml(XMLInputStream xis)
throws IOException,
SQLException
IOException
SQLException
public void readXml(Reader reader)
throws SQLException
readXml in interface WebRowSetSQLException
public void readXml(InputStream iStream)
throws SQLException,
IOException
readXml in interface WebRowSetSQLException
IOException
public void writeXml(Writer oWriter)
throws SQLException
writeXml in interface WebRowSetSQLException
public void writeXml(OutputStream oStream)
throws SQLException,
IOException
writeXml in interface WebRowSetSQLException
IOException
public void writeXml(ResultSet rs,
Writer writer)
throws SQLException
writeXml in interface WebRowSetSQLException
public void writeXml(ResultSet rs,
OutputStream oStream)
throws SQLException,
IOException
writeXml in interface WebRowSetSQLException
IOExceptionprotected Object clone()
clone in class Object
public RowSet createShared()
throws SQLException
createShared in interface CachedRowSetSQLException
public CachedRowSet createCopy()
throws SQLException
createCopy in interface CachedRowSetSQLException
public CachedRowSet createCopySchema()
throws SQLException
createCopySchema in interface CachedRowSetSQLException
public CachedRowSet createCopyNoConstraints()
throws SQLException
createCopyNoConstraints in interface CachedRowSetSQLExceptionpublic void close()
close in interface ResultSet
public void release()
throws SQLException
release in interface CachedRowSetSQLException
public boolean previousPage()
throws SQLException
previousPage in interface CachedRowSetSQLException
public boolean nextPage()
throws SQLException
nextPage in interface CachedRowSetSQLExceptionpublic int getPageSize()
getPageSize in interface CachedRowSet
public void setPageSize(int i)
throws SQLException
setPageSize in interface CachedRowSetSQLException
public void rowSetPopulated(RowSetEvent rse,
int i)
throws SQLException
rowSetPopulated in interface CachedRowSetSQLException
public void rollback(Savepoint s)
throws SQLException
rollback in interface CachedRowSetSQLException
public void rollback()
throws SQLException
rollback in interface CachedRowSetSQLException
public void commit()
throws SQLException
commit in interface CachedRowSetSQLException
public Object unwrap(Class iface)
throws SQLException
unwrap in interface WrapperSQLException
public boolean isWrapperFor(Class iface)
throws SQLException
isWrapperFor in interface WrapperSQLException
|
Because this information documents a Tech Preview of a BEA product, it may be incomplete and is subject to change. Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/essex/TechPreview Copyright 2007 BEA Systems Inc. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||