|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.sql.rowset.BaseRowSet com.sun.sql.rowset.BaseRowSetX
An abstract class extending javax.sql.rowset.BaseRowSet
which contains
changes necessary to support using RowSets as java beans.
Field Summary |
Fields inherited from class javax.sql.rowset.BaseRowSet |
ASCII_STREAM_PARAM, asciiStream, BINARY_STREAM_PARAM, binaryStream, charStream, UNICODE_STREAM_PARAM, unicodeStream |
Constructor Summary | |
BaseRowSetX()
|
Method Summary | |
int |
getFetchDirection()
Retrieves this RowSet object's current setting for the
fetch direction. |
int |
getFetchSize()
Returns the fetch size for this RowSet object. |
int |
getMaxRows()
Retrieves the maximum number of rows that this RowSet object may contain. |
void |
setCommand(java.lang.String cmd)
Sets this RowSet object's command property to
the given String object and clears the parameters, if any,
that were set for the previous command. |
void |
setDataSourceName(java.lang.String name)
Sets the DataSource name property for this RowSet
object to the given logical name and sets this RowSet object's
Url property to null . |
void |
setFetchDirection(int direction)
Gives the driver a performance hint as to the direction in which the rows in this RowSet object will be
processed. |
void |
setFetchSize(int rows)
Sets the fetch size for this RowSet object to the given number of
rows. |
void |
setMaxRows(int max)
Sets the maximum number of rows that this RowSet object may contain to
the given number. |
void |
setUrl(java.lang.String url)
Sets the Url property for this RowSet object
to the given String object and sets the dataSource name
property to null . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BaseRowSetX()
Method Detail |
public void setCommand(java.lang.String cmd) throws java.sql.SQLException
RowSet
object's command
property to
the given String
object and clears the parameters, if any,
that were set for the previous command.
The command
property may not be needed if the RowSet
object gets its data from a source that does not support commands,
such as a spreadsheet or other tabular file.
Thus, this property is optional and may be null
.
setCommand
in class BaseRowSet
cmd
- a String
object containing an SQL query
that will be set as this RowSet
object's command
property; may be null
but may not be an empty string
java.sql.SQLException
- if an empty string is provided as the command valueBaseRowSet.getCommand()
public void setUrl(java.lang.String url) throws java.sql.SQLException
RowSet
object
to the given String
object and sets the dataSource name
property to null
. The Url property is a
JDBC URL that is used when
the connection is created using a JDBC technology-enabled driver
("JDBC driver") and the DriverManager
.
The correct JDBC URL for the specific driver to be used can be found
in the driver documentation. Although there are guidelines for for how
a JDBC URL is formed,
a driver vendor can specify any String
object except
one with a length of 0
(an empty string).
Setting the Url property is optional if connections are established using
a DataSource
object instead of the DriverManager
.
The driver will use either the URL property or the
dataSourceName property to create a connection, whichever was
specified most recently. If an application uses a JDBC URL, it
must load a JDBC driver that accepts the JDBC URL before it uses the
RowSet
object to connect to a database. The RowSet
object will use the URL internally to create a database connection in order
to read or write data.
setUrl
in class BaseRowSet
url
- a String
object that contains the JDBC URL
that will be used to establish the connection to a database for this
RowSet
object; may be null
but must not
be an empty string
java.sql.SQLException
- if an error occurs setting the Url property or the
parameter supplied is a string with a length of 0
(an
empty string)BaseRowSet.getUrl()
public void setDataSourceName(java.lang.String name) throws java.sql.SQLException
DataSource
name property for this RowSet
object to the given logical name and sets this RowSet
object's
Url property to null
. The name must have been bound to a
DataSource
object in a JNDI naming service so that an
application can do a lookup using that name to retrieve the
DataSource
object bound to it. The DataSource
object can then be used to establish a connection to the data source it
represents.
Users should set either the Url property or the dataSourceName property. If both properties are set, the driver will use the property set most recently.
setDataSourceName
in class BaseRowSet
name
- a String
object with the name that can be supplied
to a naming service based on JNDI technology to retrieve the
DataSource
object that can be used to get a connection;
may be null
but must not be an empty string
java.sql.SQLException
- if there is a problem setting the
dataSourceName
property or name is an empty stringBaseRowSet.getDataSourceName()
public void setMaxRows(int max) throws java.sql.SQLException
RowSet
object may contain to
the given number. If this limit is exceeded, the excess rows are
silently dropped.
setMaxRows
in class BaseRowSet
max
- an int
indicating the current maximum number
of rows; zero means that there is no limit
java.sql.SQLException
- if an error occurs internally setting the
maximum limit on the number of rows that a JDBC RowSet
object
can contain; or if max is less than 0
; or
if max is less than the fetchSize
of the
RowSet
public int getMaxRows() throws java.sql.SQLException
RowSet
object may contain. If
this limit is exceeded, the excess rows are silently dropped.
getMaxRows
in class BaseRowSet
int
indicating the current maximum number of
rows; zero means that there is no limit
java.sql.SQLException
- if an error occurs internally determining the
maximum limit of rows that a Rowset
object can containpublic void setFetchDirection(int direction) throws java.sql.SQLException
RowSet
object will be
processed. The driver may ignore this hint.
A RowSet
object inherits the default properties of the
ResultSet
object from which it got its data. That
ResultSet
object's default fetch direction is set by
the Statement
object that created it.
This method applies to a RowSet
object only while it is
connected to a database using a JDBC driver.
A RowSet
object may use this method at any time to change
its setting for the fetch direction.
setFetchDirection
in class BaseRowSet
direction
- one of ResultSet.FETCH_FORWARD
,
ResultSet.FETCH_REVERSE
, or
ResultSet.FETCH_UNKNOWN
java.sql.SQLException
- if (1) the RowSet
type is
TYPE_FORWARD_ONLY
and the given fetch direction is not
FETCH_FORWARD
or (2) the given fetch direction is not
one of the following:
ResultSet.FETCH_FORWARD,
ResultSet.FETCH_REVERSE, or
ResultSet.FETCH_UNKNOWNgetFetchDirection()
public int getFetchDirection() throws java.sql.SQLException
RowSet
object's current setting for the
fetch direction. The default type is ResultSet.FETCH_FORWARD
getFetchDirection
in class BaseRowSet
ResultSet.FETCH_FORWARD
,
ResultSet.FETCH_REVERSE
, or
ResultSet.FETCH_UNKNOWN
java.sql.SQLException
- if an error occurs in determining the
current fetch direction for fetching rowssetFetchDirection(int)
public void setFetchSize(int rows) throws java.sql.SQLException
RowSet
object to the given number of
rows. The fetch size gives a JDBC technology-enabled driver ("JDBC driver")
a hint as to the
number of rows that should be fetched from the database when more rows
are needed for this RowSet
object. If the fetch size specified
is zero, the driver ignores the value and is free to make its own best guess
as to what the fetch size should be.
A RowSet
object inherits the default properties of the
ResultSet
object from which it got its data. That
ResultSet
object's default fetch size is set by
the Statement
object that created it.
This method applies to a RowSet
object only while it is
connected to a database using a JDBC driver.
For connected RowSet
implementations such as
JdbcRowSet
, this method has a direct and immediate effect
on the underlying JDBC driver.
A RowSet
object may use this method at any time to change
its setting for the fetch size.
For RowSet
implementations such as
CachedRowSet
, which operate in a disconnected environment,
the SyncProvider
object being used
may leverage the fetch size to poll the data source and
retrieve a number of rows that do not exceed the fetch size and that may
form a subset of the actual rows returned by the original query. This is
an implementation variance determined by the specific SyncProvider
object employed by the disconnected RowSet
object.
setFetchSize
in class BaseRowSet
rows
- the number of rows to fetch; 0
to let the
driver decide what the best fetch size is; must not be less
than 0
or more than the maximum number of rows
allowed for this RowSet
object (the number returned
by a call to the method getMaxRows()
)
java.sql.SQLException
- if the specified fetch size is less than 0
or more than the limit for the maximum number of rowsgetFetchSize()
public int getFetchSize() throws java.sql.SQLException
RowSet
object. The default
value is zero.
getFetchSize
in class BaseRowSet
RowSet
object
needs more rows from the database
java.sql.SQLException
- if an error occurs determining the number of rows in the
current fetch sizesetFetchSize(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |