javax.sql.RowSet | ResultSet |
A RowSet is an interface which provides access to data being sent from/to a database and which extends the functionality of ResultSet into a form that can be used as a JavaBeans component, perhaps being used in a visual programming environment.
Facilities are provided for get/set of properties relating to the Database and the SQL Command and for getting/setting data within the Rows represented by the RowSet. The RowSet supports JavaBeans events so that other components in an application can be informed when various changes happen to the RowSet, such as changes in data values.
RowSet is implemented as a layer on top of the remainder of the JDBC API. A RowSet may be connected where it maintains a connection to the database throughout its lifecycle. A RowSet may be disconnected where it establishes a connection to the database, gets data and then closes the connection. Updates to a disconnected RowSet can be made and later send back the changes to the database, but this requires the RowSet to first reconnect to the database before the changes are sent back.
Disconnected RowSets may make use of RowSetReaders to populate the RowSet with data, possibly from a non-relational database source. Disconnected RowSets may also use RowSetWriters to send data back to the underlying data store. There is considerable freedom in the way that RowSetReaders and RowSetWriters are implemented to get and store data.
void | addRowSetListener(RowSetListener theListener) | |||||
Registers a supplied RowSetListener with this RowSet. | ||||||
void | clearParameters() | |||||
Clears the parameters previously set for this RowSet. | ||||||
void | execute() | |||||
Fetches data for this RowSet. | ||||||
String | getCommand() | |||||
Gets the RowSet's Command property. | ||||||
String | getDataSourceName() | |||||
Gets the name of the datasource for this RowSet. | ||||||
boolean | getEscapeProcessing() | |||||
Reports if escape processing is enabled for this RowSet. | ||||||
int | getMaxFieldSize() | |||||
Gets the maximum number of bytes that can be returned for column values which are of types BINARY, VARBINARY, LONGVARBINARYBINARY, CHAR, VARCHAR, or LONGVARCHAR. | ||||||
int | getMaxRows() | |||||
Gets the maximum number of rows for this RowSet. | ||||||
String | getPassword() | |||||
Gets the value of the password property for this RowSet. | ||||||
int | getQueryTimeout() | |||||
Gets the Timeout for the driver when executing a Query operation. | ||||||
int | getTransactionIsolation() | |||||
Gets the transaction isolation property setting for this RowSet. | ||||||
Map<String, Class<?>> | getTypeMap() | |||||
Gets the custom mapping of SQL types for this RowSet, if any. | ||||||
String | getUrl() | |||||
Gets the URL property value for this RowSet. | ||||||
String | getUsername() | |||||
Gets the value of the Username property for this RowSet. | ||||||
boolean | isReadOnly() | |||||
Reports if this RowSet is read only. | ||||||
void | removeRowSetListener(RowSetListener theListener) | |||||
Removes a specified RowSetListener object from the set of listeners which will be notified of events by this RowSet. | ||||||
void | setArray(int parameterIndex, Array theArray) | |||||
Sets the specified ARRAY parameter in the RowSet command with the supplied java.sql.Array value. | ||||||
void | setAsciiStream(int parameterIndex, InputStream theInputStream, int length) | |||||
Sets the value of the specified parameter in the RowSet command with the ASCII data in the supplied java.io.InputStream value. | ||||||
void | setBigDecimal(int parameterIndex, BigDecimal theBigDecimal) | |||||
Sets the value of the specified SQL NUMERIC parameter in the RowSet command with the data in the supplied java.math.BigDecimal value. | ||||||
void | setBinaryStream(int parameterIndex, InputStream theInputStream, int length) | |||||
Sets the value of the specified parameter in the RowSet command with the binary data in the supplied java.io.InputStream value. | ||||||
void | setBlob(int parameterIndex, Blob theBlob) | |||||
Sets the value of the specified parameter in the RowSet command with the value of a supplied java.sql.Blob. | ||||||
void | setBoolean(int parameterIndex, boolean theBoolean) | |||||
Sets the value of the specified parameter in the RowSet command to the supplied boolean. | ||||||
void | setByte(int parameterIndex, byte theByte) | |||||
Sets the value of the specified parameter in the RowSet command to the supplied byte value. | ||||||
void | setBytes(int parameterIndex, byte[] theByteArray) | |||||
Sets the value of the specified parameter in the RowSet command to the supplied byte array value. | ||||||
void | setCharacterStream(int parameterIndex, Reader theReader, int length) | |||||
Sets the value of the specified parameter in the RowSet command to the sequence of Unicode characters carried by the supplied java.io.Reader. | ||||||
void | setClob(int parameterIndex, Clob theClob) | |||||
Sets the value of the specified parameter in the RowSet command with the value of a supplied java.sql.Clob. | ||||||
void | setCommand(String cmd) | |||||
Sets the Command property for this RowSet - the command is an SQL Query
which runs when the execute method is invoked. |
||||||
void | setConcurrency(int concurrency) | |||||
Sets the concurrency property of this RowSet. | ||||||
void | setDataSourceName(String name) | |||||
Sets the Data Source Name property for the RowSet. | ||||||
void | setDate(int parameterIndex, Date theDate) | |||||
Sets the value of the specified parameter in the RowSet command with the value of a supplied java.sql.Date. | ||||||
void | setDate(int parameterIndex, Date theDate, Calendar theCalendar) | |||||
Sets the value of the specified parameter in the RowSet command with the value of a supplied java.sql.Date, where the conversion of the Date to an SQL DATE value is calculated using a supplied Calendar. | ||||||
void | setDouble(int parameterIndex, double theDouble) | |||||
Sets the value of the specified parameter in the RowSet command with the supplied double. | ||||||
void | setEscapeProcessing(boolean enable) | |||||
Sets the Escape Processing status for this RowSet. | ||||||
void | setFloat(int parameterIndex, float theFloat) | |||||
Sets the value of the specified parameter in the RowSet command with the supplied float. | ||||||
void | setInt(int parameterIndex, int theInteger) | |||||
Sets the value of the specified parameter in the RowSet command with the supplied integer. | ||||||
void | setLong(int parameterIndex, long theLong) | |||||
Sets the value of the specified parameter in the RowSet command with the supplied long. | ||||||
void | setMaxFieldSize(int max) | |||||
Sets the maximum number of bytes which can be returned for a column value where the column type BINARY, VARBINARY, LONGVARBINARYBINARY, CHAR, VARCHAR, or LONGVARCHAR. | ||||||
void | setMaxRows(int max) | |||||
Sets the maximum number of rows which can be held by the RowSet. | ||||||
void | setNull(int parameterIndex, int sqlType) | |||||
Sets the value of the specified parameter in the RowSet command to SQL NULL. | ||||||
void | setNull(int parameterIndex, int sqlType, String typeName) | |||||
Sets the value of the specified parameter in the RowSet command to SQL NULL. | ||||||
void | setObject(int parameterIndex, Object theObject, int targetSqlType) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied Java object. | ||||||
void | setObject(int parameterIndex, Object theObject, int targetSqlType, int scale) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied Java object. | ||||||
void | setObject(int parameterIndex, Object theObject) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied Java object. | ||||||
void | setPassword(String password) | |||||
Sets the database Password for this RowSet. | ||||||
void | setQueryTimeout(int seconds) | |||||
Sets the Timeout value for this RowSet. | ||||||
void | setReadOnly(boolean readOnly) | |||||
Sets whether the RowSet is read only or is updateable. | ||||||
void | setRef(int parameterIndex, Ref theRef) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Ref. | ||||||
void | setShort(int parameterIndex, short theShort) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied short integer. | ||||||
void | setString(int parameterIndex, String theString) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied String. | ||||||
void | setTime(int parameterIndex, Time theTime, Calendar theCalendar) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Time, converting to an SQL TIME value using a supplied Calendar. | ||||||
void | setTime(int parameterIndex, Time theTime) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Time, converting to an SQL TIME value using the system default Calendar. | ||||||
void | setTimestamp(int parameterIndex, Timestamp theTimestamp, Calendar theCalendar) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Timestamp converting to an SQL TIMESTAMP value using a supplied Calendar. | ||||||
void | setTimestamp(int parameterIndex, Timestamp theTimestamp) | |||||
Sets the value of the specified parameter in the RowSet command to a supplied java.sql.Timestamp, converting to an SQL TIMESTAMP value using the system default Calendar. | ||||||
void | setTransactionIsolation(int level) | |||||
Updates the target instance's transaction isolation level to one of a discrete set of possible values. | ||||||
void | setType(int type) | |||||
Sets the type of this RowSet. | ||||||
void | setTypeMap(Map<String, Class<?>> theTypeMap) | |||||
Sets the Map used to map SQL User Defined Types to Java classes. | ||||||
void | setUrl(String theURL) | |||||
Sets the URL used by this RowSet to access the database via a
DriverManager . |
||||||
void | setUsername(String theUsername) | |||||
Sets the Username property for the RowSet, used to authenticate a connection to the database. |
theListener | an object which implements the rowSetListener
interface.
|
---|
Parameter values apply to repeated use of a RowSet object. Setting a new
value for a parameter clears its previous value.
clearParameters
clears the values for all parameters with
one method call.
SQLException | if a problem occurs accessing the database |
---|
Data is retrieved connects to the database and executes a Command. This requires some or all of the following properties to be set: url, data source name, user name, password, transaction isolation, type map ; plus some or all of the properties: command, read only, maximum field size, maximum rows, escape processing, and query timeout.
The RowSet may use a RowSetReader to access the database - in this case a
reader must be registered with the RowSet and the RowSet will then invoke
the readData
method on the reader to fetch the data.
SQLException | if a problem occurs accessing the database or if the properties needed to access the database have not been set |
---|
If true
(the default) the driver will automatically
perform escape code processing on SQL statements prior to them being sent
to the database.
SQLException | if a problem occurs accessing the database |
---|
SQLException | if a problem occurs accessing the database |
---|
SQLException | if a problem occurs accessing the database |
---|
execute
method.
If a Query takes longer than the Timeout, an exception is thrown.
SQLException | if an error occurs accessing the database. |
---|
SQLException | if an error occurs accessing the database. |
---|
SQLException | if an error occurs accessing the database. |
---|
execute
method is invoked.
theListener | the RowSetListener to remove from the set of listeners for this RowSet. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theArray | the java.sql.Array value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theInputStream | an InputStream containing the ASCII data to set into the parameter value |
length | the length of the data in bytes |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theBigDecimal | the BigDecimal containing the value |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theInputStream | an InputStream containing the binary data to set into the parameter value |
length | the length of the data in bytes |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theBlob | the Blob value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theBoolean | the boolean value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theByte | the byte value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theByteArray | the array of bytes to set into the parameter. |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theReader | the Reader which contains the Unicode data to set into the parameter |
length | the length of the data in the Reader in characters |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theClob | the Clob value to set |
SQLException | if an error occurs accessing the database. |
---|
execute
method is invoked. This
property is optional for datasources that do not support commands.
cmd | a String containing the SQL Query. Can be null. |
---|
SQLException | if an error occurs accessing the database. |
---|
concurrency | the new concurrency value - one of: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE |
---|
SQLException | if an error occurs accessing the database. |
---|
The Data Source Name can be used to find a DataSource
which has been registered with a naming service - the DataSource can then
be used to create a connection to the database.
name | a String with the new Data Source Name. |
---|
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theDate | the Date to use |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theDate | the Date to use |
theCalendar | the Calendar to use in converting the Date to an SQL DATE value |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theDouble | the double value to set |
SQLException | if an error occurs accessing the database. |
---|
enable | true to enable Escape Processing, false to turn it off. |
---|
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theFloat | the float value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theInteger | the integer value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theLong | the long value to set |
SQLException | if an error occurs accessing the database. |
---|
max | the maximum size of the returned column value in bytes. 0 means unlimited. |
---|
SQLException | if an error occurs accessing the database. |
---|
max | the maximum number of rows which can be held in the RowSet. 0 means no limit. |
---|
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
sqlType | the type of the parameter, as defined by java.sql.Types. |
SQLException | if an error occurs accessing the database. |
---|
setNull
method should be used for
User Defined Types and REF parameters.
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
sqlType | the type of the parameter, as defined by java.sql.Types. |
typeName | the fully qualified name of an SQL User Defined Type or the name of the SQL structured type referenced by a REF type. Ignored if the sqlType is not a UDT or REF type. |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theObject | the Java object containing the data value. |
targetSqlType | the SQL type to send to the database, as defined in java.sql.Types. |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theObject | the Java object containing the data value. |
targetSqlType | the SQL type to send to the database, as defined in java.sql.Types. |
scale | the number of digits after the decimal point, for java.sql.Types.DECIMAL and java.sql.Types.NUMERIC types. Ignored for all other types. |
SQLException | if an error occurs accessing the database. |
---|
The JDBC specification provides a standard mapping for Java objects to SQL data types. Database specific types can be mapped by JDBC driver specific Java types.
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theObject | the Java object containing the data value. |
SQLException | if an error occurs accessing the database. |
---|
password | a string holding the new password |
---|
SQLException | if an error occurs accessing the database. |
---|
seconds | the number of seconds for the Timeout. |
---|
SQLException | if an error occurs accessing the database. |
---|
readOnly | true to set the RowSet to readonly state, false to allow updates. |
---|
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theRef | the Ref value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theShort | the short value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theTime | the Time value to set |
theCalendar | the Calendar to use in the conversion operation |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theTime | the Time value to set |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|---|
theCalendar | the Calendar to use in the conversion operation |
SQLException | if an error occurs accessing the database. |
---|
parameterIndex | index of the parameter to set, where the first parameter has index = 1. |
---|
SQLException | if an error occurs accessing the database. |
---|
level | the new transaction isolation level. One of: Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE |
---|
SQLException | if an error occurs accessing the database. |
---|
type | the new type for the RowSet. One of: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE |
---|
SQLException | if an error occurs accessing the database. |
---|
theTypeMap | a Map which defines the names of SQL UDTs and the Java classes to which they are mapped. |
---|
SQLException | if an error occurs accessing the database. |
---|
DriverManager
. The URL is optional - an alternative is to
use a Data Source Name to create a connection.
theURL | a String containing the URL for the database. Can be null. |
---|
SQLException | if an error occurs accessing the database. |
---|
theUsername | a String containing the User Name |
---|
SQLException | if an error occurs accessing the database. |
---|
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:56 |