The RowSet interface adds support to the JDBC API for the JavaBeans(TM) component model. A rowset can be used as a JavaBean in a visual Bean development environment. A RowSet can be created and configured at design time and executed at runtime. 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 setXXX() methods provide a way to pass input parameters to a rowset. The RowSet interface supports JavaBeans events, allowing other components in an application to be notified when an important event on a rowset occurs, 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(TM) 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.
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 ResultSets will also easily be made to work with rowsets.
CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
boolean
getEscapeProcessing()
int
getMaxFieldSize()
int
getQueryTimeout()
int
getTransactionIsolation()
void
setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length)
void
setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
void
setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length)
void
setCharacterStream(int parameterIndex,
java.io.Reader reader,
int length)
void
setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal)
void
setEscapeProcessing(boolean enable)
void
setMaxFieldSize(int max)
void
setMaxRows(int max)
void
setNull(int paramIndex,
int sqlType,
java.lang.String typeName)
void
setObject(int parameterIndex,
java.lang.Object x)
void
setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType)
void
setObject(int parameterIndex,
java.lang.Object x,
int targetSqlType,
int scale)
void
setQueryTimeout(int seconds)
void
setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar cal)
void
setTimestamp(int parameterIndex,
java.sql.Timestamp x)
void
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal)
void
setTypeMap(java.util.Map map)
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, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
public java.lang.String getUrl() throws java.sql.SQLException
java.sql.SQLException
- if a database-access error occurs.public void setUrl(java.lang.String url) throws java.sql.SQLException
url
- a string value, may be nulljava.sql.SQLException
- if a database-access error occurs.public java.lang.String getDataSourceName()
public void setDataSourceName(java.lang.String name) throws java.sql.SQLException
name
- a data source namejava.sql.SQLException
- if a database-access error occurs.public java.lang.String getUsername()
public void setUsername(java.lang.String name) throws java.sql.SQLException
name
- a user namejava.sql.SQLException
- if a database-access error occurs.public java.lang.String getPassword()
public void setPassword(java.lang.String password) throws java.sql.SQLException
password
- the password stringjava.sql.SQLException
- if a database-access error occurs.public int getTransactionIsolation()
public void setTransactionIsolation(int level) throws java.sql.SQLException
level
- the transaction isolation leveljava.sql.SQLException
- if a database-access error occurs.public java.util.Map getTypeMap() throws java.sql.SQLException
java.sql.SQLException
- if a database-access error occurs.public void setTypeMap(java.util.Map map) throws java.sql.SQLException
map
- a map objectjava.sql.SQLException
- if a database-access error occurs.public java.lang.String getCommand()
public void setCommand(java.lang.String cmd) throws java.sql.SQLException
cmd
- a command string, may be nulljava.sql.SQLException
- if a database-access error occurs.public boolean isReadOnly()
public void setReadOnly(boolean value) throws java.sql.SQLException
value
- true if read-only, false otherwisejava.sql.SQLException
- if a database-access error occurs.public int getMaxFieldSize() throws java.sql.SQLException
java.sql.SQLException
- if a database-access error occurs.public void setMaxFieldSize(int max) throws java.sql.SQLException
max
- the new max column size limit; zero means unlimitedjava.sql.SQLException
- if a database-access error occurs.public int getMaxRows() throws java.sql.SQLException
java.sql.SQLException
- if a database-access error occurs.public void setMaxRows(int max) throws java.sql.SQLException
max
- the new max rows limit; zero means unlimitedjava.sql.SQLException
- if a database-access error occurs.public boolean getEscapeProcessing() throws java.sql.SQLException
java.sql.SQLException
- if a database-access error occurs.public void setEscapeProcessing(boolean enable) throws java.sql.SQLException
enable
- true to enable; false to disablejava.sql.SQLException
- if a database-access error occurs.public int getQueryTimeout() throws java.sql.SQLException
java.sql.SQLException
- if a database-access error occurs.public void setQueryTimeout(int seconds) throws java.sql.SQLException
seconds
- the new query timeout limit in seconds; zero means
unlimitedjava.sql.SQLException
- if a database-access error occurs.public void setType(int type) throws java.sql.SQLException
type
- a value from ResultSet.TYPE_XXXjava.sql.SQLException
- if a database-access error occurs.public void setConcurrency(int concurrency) throws java.sql.SQLException
concurrency
- a value from ResultSet.CONCUR_XXXjava.sql.SQLException
- if a database-access error occurs.public void setNull(int parameterIndex, int sqlType) throws java.sql.SQLException
Note: You must specify the parameter's SQL type.
parameterIndex
- the first parameter is 1, the second is 2, ...sqlType
- SQL type code defined by java.sql.Typesjava.sql.SQLException
- if a database-access error occurs.public void setNull(int paramIndex, int sqlType, java.lang.String typeName) throws java.sql.SQLException
Note: To be portable, applications must give the SQL type code and the fully qualified SQL type name when specifying a NULL user-named or REF parameter. In the case of a user-named type the name is the type name of the parameter itself. For a REF parameter the name is the type name of the referenced type. If a JDBC driver does not need the type code or type name information, it may ignore it. Although it is intended for user-named and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-named or REF type then the typeName is ignored.
parameterIndex
- the first parameter is 1, the second is 2, ...sqlType
- a value from java.sql.TypestypeName
- the fully qualified name of a SQL user-named type,
ignored if the parameter is not a user-named type or REFjava.sql.SQLException
- if a database-access error occurs.public void setBoolean(int parameterIndex, boolean x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setByte(int parameterIndex, byte x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setShort(int parameterIndex, short x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setInt(int parameterIndex, int x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setLong(int parameterIndex, long x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setFloat(int parameterIndex, float x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setDouble(int parameterIndex, double x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setString(int parameterIndex, java.lang.String x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setBytes(int parameterIndex, byte[] x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setDate(int parameterIndex, java.sql.Date x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setTime(int parameterIndex, java.sql.Time x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setTimestamp(int parameterIndex, java.sql.Timestamp x) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java input stream which contains the ASCII parameter valuelength
- the number of bytes in the streamjava.sql.SQLException
- if a database-access error occurs.public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java input stream which contains the binary parameter valuelength
- the number of bytes in the streamjava.sql.SQLException
- if a database-access error occurs.public void setCharacterStream(int parameterIndex, java.io.Reader reader, int length) throws java.sql.SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the java reader which contains the UNICODE datalength
- the number of characters in the streamjava.sql.SQLException
- if a database-access error occurs.public void setObject(int parameterIndex, java.lang.Object x, int targetSqlType, int scale) throws java.sql.SQLException
Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.
The given Java object will be converted to the targetSqlType before being sent to the database. If the object is of a class implementing SQLData, the rowset should call its method writeSQL() to write it to the SQL data stream. else If the object is of a class implementing Ref, Blob, Clob, Struct, or Array then pass it to the database as a value of the corresponding SQL type.
Note that this method may be used to pass datatabase- specific abstract data types.
parameterIndex
- The first parameter is 1, the second is 2, ...x
- The object containing the input parameter valuetargetSqlType
- The SQL type (as defined in java.sql.Types) to be
sent to the database. The scale argument may further qualify this type.scale
- For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
this is the number of digits after the decimal. For all other
types this value will be ignored,java.sql.SQLException
- if a database-access error occurs.Types
public void setObject(int parameterIndex, java.lang.Object x, int targetSqlType) throws java.sql.SQLException
java.sql.SQLException
- if a database-access error occurs.public void setObject(int parameterIndex, java.lang.Object x) throws java.sql.SQLException
Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.
The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument java object will be converted to the corresponding SQL type before being sent to the database.
Note that this method may be used to pass datatabase specific abstract data types, by using a Driver specific Java type. If the object is of a class implementing SQLData, the rowset should call its method writeSQL() to write it to the SQL data stream. else If the object is of a class implementing Ref, Blob, Clob, Struct, or Array then pass it to the database as a value of the corresponding SQL type. Raise an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of those interfaces.
parameterIndex
- The first parameter is 1, the second is 2, ...x
- The object containing the input parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setRef(int i, java.sql.Ref x) throws java.sql.SQLException
i
- the first parameter is 1, the second is 2, ...x
- an object representing data of an SQL REF Typepublic void setBlob(int i, java.sql.Blob x) throws java.sql.SQLException
i
- the first parameter is 1, the second is 2, ...x
- an object representing a BLOBpublic void setClob(int i, java.sql.Clob x) throws java.sql.SQLException
i
- the first parameter is 1, the second is 2, ...x
- an object representing a CLOBpublic void setArray(int i, java.sql.Array x) throws java.sql.SQLException
i
- the first parameter is 1, the second is 2, ...x
- an object representing an SQL arraypublic void setDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...x
- the parameter valuejava.sql.SQLException
- if a database-access error occurs.public void clearParameters() throws java.sql.SQLException
In general, parameter values remain in force for repeated use of a RowSet. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling clearParameters.
java.sql.SQLException
- if a database-access error occurs.public void execute() throws java.sql.SQLException
java.sql.SQLException
- if a database-access error occurs.public void addRowSetListener(RowSetListener listener)
listener
- an event listenerpublic void removeRowSetListener(RowSetListener listener)
listener
- an event listener