com.sun.sql.rowset
Class BaseRowSetX

java.lang.Object
  extended byjavax.sql.rowset.BaseRowSet
      extended bycom.sun.sql.rowset.BaseRowSetX
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
CachedRowSetXImpl, JdbcRowSetXImpl

public abstract class BaseRowSetX
extends BaseRowSet

An abstract class extending javax.sql.rowset.BaseRowSet which contains changes necessary to support using RowSets as java beans.

See Also:
Serialized Form

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 javax.sql.rowset.BaseRowSet
addRowSetListener, clearParameters, getCommand, getConcurrency, getDataSourceName, getEscapeProcessing, getMaxFieldSize, getParams, getPassword, getQueryTimeout, getShowDeleted, getTransactionIsolation, getType, getTypeMap, getUrl, getUsername, initParams, isReadOnly, notifyCursorMoved, notifyRowChanged, notifyRowSetChanged, removeRowSetListener, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setConcurrency, setDate, setDate, setDouble, setEscapeProcessing, setFloat, setInt, setLong, setMaxFieldSize, setNull, setNull, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setRef, setShort, setShowDeleted, setString, setTime, setTime, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseRowSetX

public BaseRowSetX()
Method Detail

setCommand

public void setCommand(java.lang.String cmd)
                throws java.sql.SQLException
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.

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.

Overrides:
setCommand in class BaseRowSet
Parameters:
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
Throws:
java.sql.SQLException - if an empty string is provided as the command value
See Also:
BaseRowSet.getCommand()

setUrl

public void setUrl(java.lang.String url)
            throws java.sql.SQLException
Sets the Url property for this 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.

Overrides:
setUrl in class BaseRowSet
Parameters:
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
Throws:
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)
See Also:
BaseRowSet.getUrl()

setDataSourceName

public void setDataSourceName(java.lang.String name)
                       throws java.sql.SQLException
Sets the 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.

Overrides:
setDataSourceName in class BaseRowSet
Parameters:
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
Throws:
java.sql.SQLException - if there is a problem setting the dataSourceName property or name is an empty string
See Also:
BaseRowSet.getDataSourceName()

setMaxRows

public void setMaxRows(int max)
                throws java.sql.SQLException
Sets the maximum number of rows that this RowSet object may contain to the given number. If this limit is exceeded, the excess rows are silently dropped.

Overrides:
setMaxRows in class BaseRowSet
Parameters:
max - an int indicating the current maximum number of rows; zero means that there is no limit
Throws:
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

getMaxRows

public int getMaxRows()
               throws java.sql.SQLException
Retrieves the maximum number of rows that this RowSet object may contain. If this limit is exceeded, the excess rows are silently dropped.

Overrides:
getMaxRows in class BaseRowSet
Returns:
an int indicating the current maximum number of rows; zero means that there is no limit
Throws:
java.sql.SQLException - if an error occurs internally determining the maximum limit of rows that a Rowset object can contain

setFetchDirection

public void setFetchDirection(int direction)
                       throws java.sql.SQLException
Gives the driver a performance hint as to the direction in which the rows in this 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.

Overrides:
setFetchDirection in class BaseRowSet
Parameters:
direction - one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN
Throws:
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_UNKNOWN
See Also:
getFetchDirection()

getFetchDirection

public int getFetchDirection()
                      throws java.sql.SQLException
Retrieves this RowSet object's current setting for the fetch direction. The default type is ResultSet.FETCH_FORWARD

Overrides:
getFetchDirection in class BaseRowSet
Returns:
one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN
Throws:
java.sql.SQLException - if an error occurs in determining the current fetch direction for fetching rows
See Also:
setFetchDirection(int)

setFetchSize

public void setFetchSize(int rows)
                  throws java.sql.SQLException
Sets the fetch size for this 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.

Overrides:
setFetchSize in class BaseRowSet
Parameters:
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())
Throws:
java.sql.SQLException - if the specified fetch size is less than 0 or more than the limit for the maximum number of rows
See Also:
getFetchSize()

getFetchSize

public int getFetchSize()
                 throws java.sql.SQLException
Returns the fetch size for this RowSet object. The default value is zero.

Overrides:
getFetchSize in class BaseRowSet
Returns:
the number of rows suggested as the fetch size when this RowSet object needs more rows from the database
Throws:
java.sql.SQLException - if an error occurs determining the number of rows in the current fetch size
See Also:
setFetchSize(int)