|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sql.rowset.internal.CachedRowSetXReader
public class CachedRowSetXReader
An implementation of RowSetReader to work with CachedRowSetX rowsets. Based on the Sun reference implementation of CachedRowSetReader.
SyncProvider,
SyncFactory,
SyncFactoryException,
Serialized Form| Constructor Summary | |
|---|---|
CachedRowSetXReader()
|
|
| Method Summary | |
|---|---|
java.sql.Connection |
connect(javax.sql.RowSetInternal caller)
Establishes a connection with the data source for the given RowSet object. |
protected boolean |
getCloseConnection()
Assists in determining whether the current connection was created by this CachedRowSet to ensure incorrect connections are not prematurely terminated. |
void |
readData(javax.sql.RowSetInternal caller)
Reads data from a data source and populates the given RowSet object with that data. |
boolean |
reset()
Checks to see if the writer associated with this reader needs to reset its state. |
void |
setStartPosition(int pos)
This sets the start position in the ResultSet from where to begin. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachedRowSetXReader()
| Method Detail |
|---|
public void readData(javax.sql.RowSetInternal caller)
throws java.sql.SQLException
RowSet object with that data.
This method is called by the rowset internally when
the application invokes the method execute
to read a new set of rows.
After clearing the rowset of its contents, if any, and setting
the number of writer calls to 0, this reader calls
its connect method to make
a connection to the rowset's data source. Depending on which
of the rowset's properties have been set, the connect
method will use a DataSource object or the
DriverManager facility to make a connection to the
data source.
Once the connection to the data source is made, this reader
executes the query in the calling CachedRowSet object's
command property. Then it calls the rowset's
populate method, which reads data from the
ResultSet object produced by executing the rowset's
command. The rowset is then populated with this data.
This method's final act is to close the connection it made, thus leaving the rowset disconnected from its data source.
readData in interface javax.sql.RowSetReadercaller - a RowSet object that has implemented
the RowSetInternal interface and had
this CachedRowSetXReader object set as
its reader
java.sql.SQLException - if there is a database access error, there is a
problem making the connection, or the command property has not
been set
public boolean reset()
throws java.sql.SQLException
true if writer associated with this reader needs
to reset the values of its fields; false otherwise
java.sql.SQLException - if an access error occurs
public java.sql.Connection connect(javax.sql.RowSetInternal caller)
throws java.sql.SQLException
RowSet object. If the rowset's dataSourceName
property has been set, this method uses the JNDI API to retrieve the
DataSource object that it can use to make the connection.
If the url, username, and password properties have been set, this
method uses the DriverManager.getConnection method to
make the connection.
This method is used internally by the reader and writer associated with
the calling RowSet object; an application never calls it
directly.
caller - a RowSet object that has implemented
the RowSetInternal interface and had
this CachedRowSetXReader object set as
its reader
Connection object that represents a connection
to the caller's data source
java.sql.SQLException - if an access error occursprotected boolean getCloseConnection()
public void setStartPosition(int pos)
pos - integer indicating the position in the ResultSet to begin
populating from.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||