RIOptimisticProvider
object
internally to read data into it. The calling RowSet
object
must have implemented the RowSetInternal
interface
and have the standard CachedRowSetReader
object set as its
reader.
This implementation always reads all rows of the data source,
and it assumes that the command
property for the caller
is set with a query that is appropriate for execution by a
PreparedStatement
object.
Typically the SyncFactory
manages the RowSetReader
and
the RowSetWriter
implementations using SyncProvider
objects.
Standard JDBC RowSet implementations provide an object instance of this
reader by invoking the SyncProvider.getRowSetReader()
method.
javax.sql.rowset.spi.SyncProvider
, javax.sql.rowset.spi.SyncFactory
, javax.sql.rowset.spi.SyncFactoryException
Modifier and Type | Field and Description |
---|---|
private JdbcRowSetResourceBundle | |
pack-priv static final long | |
private int | |
private boolean | |
private int | writerCalls
The field that keeps track of whether the writer associated with
this |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public Connection | Returns: aConnection object that represents a connection
to the caller's data sourcea caller)RowSet object that has implemented
the RowSetInternal interface and had
this CachedRowSetReader object set as
its readerEstablishes a connection with the data source for the given
|
private void | decodeParams(Object[]
an array of parameters to be used with the given
params, PreparedStatement PreparedStatement objectthe pstmt)PreparedStatement object that is the
command for the calling rowset and into which
the given parameters are to be setSets the parameter placeholders
in the rowset's command (the given |
protected boolean | Returns: a boolean giving the status of whether the connection has been closed.Assists in determining whether the current connection was created by this CachedRowSet to ensure incorrect connections are not prematurely terminated. |
public void | readData(RowSetInternal
a caller)RowSet object that has implemented
the RowSetInternal interface and had
this CachedRowSetReader object set as
its readerImplements javax. RowSet object with that data.
|
private void | |
public boolean | Returns: true if writer associated with this reader needs
to reset the values of its fields; false otherwiseChecks to see if the writer associated with this reader needs to reset its state. |
public void | setStartPosition(int
integer indicating the position in the pos)ResultSet to begin
populating from.This sets the start position in the ResultSet from where to begin. |
resBundle | back to summary |
---|---|
private JdbcRowSetResourceBundle resBundle |
serialVersionUID | back to summary |
---|---|
pack-priv static final long serialVersionUID |
startPosition | back to summary |
---|---|
private int startPosition |
userCon | back to summary |
---|---|
private boolean userCon |
writerCalls | back to summary |
---|---|
private int writerCalls The field that keeps track of whether the writer associated with
this
When this |
CachedRowSetReader | back to summary |
---|---|
public CachedRowSetReader() |
connect | back to summary |
---|---|
public Connection connect(RowSetInternal caller) throws SQLException Establishes a connection with the data source for the given
This method is used internally by the reader and writer associated with
the calling
|
decodeParams | back to summary |
---|---|
private void decodeParams(Object[] params, PreparedStatement pstmt) throws SQLException Sets the parameter placeholders
in the rowset's command (the given
|
getCloseConnection | back to summary |
---|---|
protected boolean getCloseConnection() Assists in determining whether the current connection was created by this CachedRowSet to ensure incorrect connections are not prematurely terminated.
|
readData | back to summary |
---|---|
public void readData(RowSetInternal caller) throws SQLException Implements javax. Reads data from a data source and populates the given
After clearing the rowset of its contents, if any, and setting
the number of writer calls to
Once the connection to the data source is made, this reader
executes the query in the calling This method's final act is to close the connection it made, thus leaving the rowset disconnected from its data source.
|
readObject | back to summary |
---|---|
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException |
reset | back to summary |
---|---|
public boolean reset() throws SQLException Checks to see if the writer associated with this reader needs to reset its state. The writer will need to initialize its state if new contents have been read since the writer was last called. This method is called by the writer that was registered with this reader when components were being wired together.
|
setStartPosition | back to summary |
---|---|
public void setStartPosition(int pos) This sets the start position in the ResultSet from where to begin. This is called by the Reader in the CachedRowSetImpl to set the position on the page to begin populating from.
|