javax.sql
Interface RowSet

All Superinterfaces:
ResultSet
public interface RowSet
extends ResultSet

The interface that adds support to the JDBC API for the JavaBeansTM component model. A rowset, which can be used as a JavaBeans component in a visual Bean development environment, can be created and configured at design time and executed at run time.

The RowSet interface provides a set of JavaBeans properties that allow a RowSet instance to be configured to connect to a JDBC data source and read some data from the data source. A group of setter methods (setInt, setBytes, setString, and so on) provide a way to pass input parameters to a rowset's command property. This command is the SQL query the rowset uses when it gets its data from a relational database, which is generally the case.

The RowSet interface supports JavaBeans events, allowing other components in an application to be notified when an event occurs on a rowset, such as a change in its value.

The RowSet interface is unique in that it is intended to be implemented using the rest of the JDBC API. In other words, a RowSet implementation is a layer of software that executes "on top" of a JDBC driver. Implementations of the RowSet interface can be provided by anyone, including JDBC driver vendors who want to provide a RowSet implementation as part of their JDBC products.

A RowSet object may make a connection with a data source and maintain that connection throughout its life cycle, in which case it is called a connected rowset. A rowset may also make a connection with a data source, get data from it, and then close the connection. Such a rowset is called a disconnected rowset. A disconnected rowset may make changes to its data while it is disconnected and then send the changes back to the original source of the data, but it must reestablish a connection to do so.

A disconnected rowset may have a reader (a RowSetReader object) and a writer (a RowSetWriter object) associated with it. The reader may be implemented in many different ways to populate a rowset with data, including getting data from a non-relational data source. The writer can also be implemented in many different ways to propagate changes made to the rowset's data back to the underlying data source.

Rowsets are easy to use. The RowSet interface extends the standard java.sql.ResultSet interface. The RowSetMetaData interface extends the java.sql.ResultSetMetaData interface. Thus, developers familiar with the JDBC API will have to learn a minimal number of new APIs to use rowsets. In addition, third-party software tools that work with JDBC ResultSet objects will also easily be made to work with rowsets.

Since:
1.4

 

Field Summary

 
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDAtable, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
 

 

Method Summary

 void addRowSetListener(RowSetListener listener)
    Registers the given listener so that it will be notified of events that occur on this RowSet object.
 void clearParameters()
    Clears the parameters set for this RowSet object's command.
 void execute()
    Fills this RowSet object with data.
 String getCommand()
    Retrieves this RowSet object's command property.
 String getDataSourceName()
    Retrieves the logical name that identifies the data source for this RowSet object.
 boolean getEscapeProcessing()
    Retrieves whether escape processing is enabled for this RowSet object.
 int getMaxFieldSize()
    Retrieves the maximum number of bytes that may be returned for certain column values.
 int getMaxRows()
    Retrieves the maximum number of rows that this RowSet object can contain.
 String getPassword()
    Retrieves the password used to create a database connection.
 int getQueryTimeout()
    Retrieves the maximum number of seconds the driver will wait for a statement to execute.
 int getTransactionIsolation()
    Retrieves the transaction isolation level set for this RowSet object.
 Map getTypeMap()
    Retrieves the Map object associated with this RowSet object, which specifies the custom mapping of SQL user-defined types, if any.
 String getUrl()
    Retrieves the url property this RowSet object will use to create a connection if it uses the DriverManager instead of a DataSource object to establish the connection.
 String getUsername()
    Retrieves the username used to create a database connection for this RowSet object.
 boolean isReadOnly()
    Retrieves whether this RowSet object is read-only.
 void removeRowSetListener(RowSetListener listener)
    Removes the specified listener from the list of components that will be notified when an event occurs on this RowSet object.
 void setArray(int i, Array x)
    Sets the designated parameter in this RowSet object's command with the given Array value.
 void setAsciiStream(int parameterIndex, InputStream x, int length)
    Sets the designated parameter in this RowSet object's command to the given java.io.InputStream value.
 void setBigDecimal(int parameterIndex, BigDecimal x)
    Sets the designated parameter in this RowSet object's command to the given java.math.BigDeciaml value.
 void setBinaryStream(int parameterIndex, InputStream x, int length)
    Sets the designated parameter in this RowSet object's command to the given java.io.InputStream value.
 void setBlob(int i, Blob x)
    Sets the designated parameter in this RowSet object's command with the given Blob value.
 void setBoolean(int parameterIndex, boolean x)
    Sets the designated parameter in this RowSet object's command to the given Java boolean value.
 void setByte(int parameterIndex, byte x)
    Sets the designated parameter in this RowSet object's command to the given Java byte value.
 void setBytes(int parameterIndex, byte[] x)
    Sets the designated parameter in this RowSet object's command to the given Java array of byte values.
 void setCharacterStream(int parameterIndex, Reader reader, int length)
    Sets the designated parameter in this RowSet object's command to the given java.io.Reader value.
 void setClob(int i, Clob x)
    Sets the designated parameter in this RowSet object's command with the given Clob value.
 void setCommand(String cmd)
    Sets this RowSet object's command property to the given SQL query.
 void setConcurrency(int concurrency)
    Sets the concurrency of this RowSet object to the given concurrency level.
 void setDataSourceName(String name)
    Sets the data source name property for this RowSet object to the given String.
 void setDate(int parameterIndex, Date x)
    Sets the designated parameter in this RowSet object's command to the given java.sql.Date value.
 void setDate(int parameterIndex, Date x, Calendar cal)
    Sets the designated parameter in this RowSet object's command with the given java.sql.Date value.
 void setDouble(int parameterIndex, double x)
    Sets the designated parameter in this RowSet object's command to the given Java double value.
 void setEscapeProcessing(boolean enable)
    Sets escape processing for this RowSet object on or off.
 void setFloat(int parameterIndex, float x)
    Sets the designated parameter in this RowSet object's command to the given Java float value.
 void setInt(int parameterIndex, int x)
    Sets the designated parameter in this RowSet object's command to the given Java int value.
 void setLong(int parameterIndex, long x)
    Sets the designated parameter in this RowSet object's command to the given Java long value.
 void setMaxFieldSize(int max)
    Sets the maximum number of bytes that can be returned for a column value to the given number of bytes.
 void setMaxRows(int max)
    Sets the maximum number of rows that this RowSet object can contain to the specified number.
 void setNull(int parameterIndex, int sqlType)
    Sets the designated parameter in this RowSet object's SQL command to SQL NULL.
 void setNull(int paramIndex, int sqlType, String typeName)
    Sets the designated parameter in this RowSet object's SQL command to SQL NULL.
 void setObject(int parameterIndex, Object x)
    Sets the designated parameter in this RowSet object's command with a Java Object.
 void setObject(int parameterIndex, Object x, int targetSqlType)
    Sets the designated parameter in this RowSet object's command with a Java Object.
 void setObject(int parameterIndex, Object x, int targetSqlType, int scale)
    Sets the designated parameter in this RowSet object's command with the given Java Object.
 void setPassword(String password)
    Sets the database password for this RowSet object to the given String.
 void setQueryTimeout(int seconds)
    Sets the maximum time the driver will wait for a statement to execute to the given number of seconds.
 void setReadOnly(boolean value)
    Sets whether this RowSet object is read-only to the given boolean.
 void setRef(int i, Ref x)
    Sets the designated parameter in this RowSet object's command with the given Ref value.
 void setShort(int parameterIndex, short x)
    Sets the designated parameter in this RowSet object's command to the given Java short value.
 void setString(int parameterIndex, String x)
    Sets the designated parameter in this RowSet object's command to the given Java String value.
 void setTime(int parameterIndex, Time x)
    Sets the designated parameter in this RowSet object's command to the given java.sql.Time value.
 void setTime(int parameterIndex, Time x, Calendar cal)
    Sets the designated parameter in this RowSet object's command with the given java.sql.Time value.
 void setTimestamp(int parameterIndex, Timestamp x)
    Sets the designated parameter in this RowSet object's command to the given java.sql.Timestamp value.
 void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
    Sets the designated parameter in this RowSet object's command with the given java.sql.Timestamp value.
 void setTransactionIsolation(int level)
    Sets the transaction isolation level for this RowSet obejct.
 void setType(int type)
    Sets the type of this RowSet object to the given type.
 void setTypeMap(Map map)
    Installs the given java.util.Map object as the default type map for this RowSet object.
 void setUrl(String url)
    Sets the URL this RowSet object will use when it uses the DriverManager to create a connection.
 void setUsername(String name)
    Sets the username property for this RowSet object to the given String.
 
Methods inherited from interface java.sql.ResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getInt, getLong, getLong, getMetaData, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getShort, getShort, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject,