|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sql.rowset.internal.CachedRowSetXWriter
public class CachedRowSetXWriter
An implementation of RowSetWriter to work with CachedRowSetX rowsets. Based on the Sun reference implementation of CachedRowSetWriter.
SyncProvider,
SyncFactory,
SyncFactoryException,
Serialized Form| Constructor Summary | |
|---|---|
CachedRowSetXWriter()
|
|
| Method Summary | |
|---|---|
void |
closeConnection()
|
void |
commit()
|
CachedRowSetXReader |
getReader()
Gets the reader for this writer. |
void |
rollback()
|
void |
rollback(java.sql.Savepoint s)
|
void |
setReader(CachedRowSetXReader reader)
Sets the reader for this writer to the given reader. |
boolean |
writeData(javax.sql.RowSetInternal caller)
Propagates changes in the given RowSet object
back to its underlying data source and returns true
if successful. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachedRowSetXWriter()
| Method Detail |
|---|
public boolean writeData(javax.sql.RowSetInternal caller)
throws java.sql.SQLException
RowSet object
back to its underlying data source and returns true
if successful. The writer will check to see if
the data in the pre-modified rowset (the original values) differ
from the data in the underlying data source. If data in the data
source has been modified by someone else, there is a conflict,
and in that case, the writer will not write to the data source.
In other words, the writer uses an optimistic concurrency algorithm:
It checks for conflicts before making changes rather than restricting
access for concurrent users.
This method is called by the rowset internally when
the application invokes the method acceptChanges.
The writeData method in turn calls private methods that
it defines internally.
The following is a general summary of what the method
writeData does, much of which is accomplished
through calls to its own internal methods.
CachedRowSet object from the given
RowSet object
initSQLStatements to initialize new SQL statements
SELECT, UPDATE,
INSERT, and DELETE statements
CachedRowSet object's metadata to
determine the table name, column names, and the columns
that make up the primary key
CachedRowSet object back to its underlying data source
CachedRowSet object
to determine whether it has been updated, inserted, or deleted
CachedRowSet object, the writer will roll
back any changes it has made to the row in the data source.
writeData in interface javax.sql.RowSetWritertrue if changes to the rowset were successfully
written to the rowset's underlying data source;
false otherwise
java.sql.SQLException
public void setReader(CachedRowSetXReader reader)
throws java.sql.SQLException
java.sql.SQLException - if a database access error occurs
public CachedRowSetXReader getReader()
throws java.sql.SQLException
java.sql.SQLException - if a database access error occurs
public void commit()
throws java.sql.SQLException
commit in interface javax.sql.rowset.spi.TransactionalWriterjava.sql.SQLException
public void rollback()
throws java.sql.SQLException
rollback in interface javax.sql.rowset.spi.TransactionalWriterjava.sql.SQLException
public void rollback(java.sql.Savepoint s)
throws java.sql.SQLException
rollback in interface javax.sql.rowset.spi.TransactionalWriterjava.sql.SQLException
public void closeConnection()
throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||