APIdia Launch Partner
Top Description Fields Constructors Methods
javax.sql.rowset

public abstract Class BaseRowSet

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
com.sun.rowset.CachedRowSetImpl, com.sun.rowset.JdbcRowSetImpl
Imports
java.sql.*, javax.sql.*, java.util.*, java.io.*, .Serializable, java.math.*, javax.sql.rowset.serial.*

An abstract class providing a RowSet object with its basic functionality. The basic functions include having properties and sending event notifications, which all JavaBeans components must implement.

1.0 Overview

The BaseRowSet class provides the core functionality for all RowSet implementations, and all standard implementations may use this class in combination with one or more RowSet interfaces in order to provide a standard vendor-specific implementation. To clarify, all implementations must implement at least one of the RowSet interfaces (JdbcRowSet, CachedRowSet, JoinRowSet, FilteredRowSet, or WebRowSet). This means that any implementation that extends the BaseRowSet class must also implement one of the RowSet interfaces.

The BaseRowSet class provides the following:

2.0 Setting Properties

All rowsets maintain a set of properties, which will usually be set using a tool. The number and kinds of properties a rowset has will vary, depending on what the RowSet implementation does and how it gets its data. For example, rowsets that get their data from a ResultSet object need to set the properties that are required for making a database connection. If a RowSet object uses the DriverManager facility to make a connection, it needs to set a property for the JDBC URL that identifies the appropriate driver, and it needs to set the properties that give the user name and password. If, on the other hand, the rowset uses a DataSource object to make the connection, which is the preferred method, it does not need to set the property for the JDBC URL. Instead, it needs to set the property for the logical name of the data source along with the properties for the user name and password.

Note

In order to use a DataSource object for making a connection, the DataSource object must have been registered with a naming service that uses the Java Naming and Directory Interface (JNDI) API. This registration is usually done by a person acting in the capacity of a system administrator.

3.0 Setting the Command and Its Parameters

When a rowset gets its data from a relational database, it executes a command (a query) that produces a ResultSet object. This query is the command that is set for the RowSet object's command property. The rowset populates itself with data by reading the data from the ResultSet object into itself. If the query contains placeholders for values to be set, the BaseRowSet setter methods are used to set these values. All setter methods allow these values to be set to null if required.

The following code fragment illustrates how the CachedRowSet object crs might have its command property set. Note that if a tool is used to set properties, this is the code that the tool would use.

crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +
                  "WHERE CREDIT_LIMIT > ? AND REGION = ?");

In this example, the values for CREDIT_LIMIT and REGION are placeholder parameters, which are indicated with a question mark (?). The first question mark is placeholder parameter number 1, the second question mark is placeholder parameter number 2, and so on. Any placeholder parameters must be set with values before the query can be executed. To set these placeholder parameters, the BaseRowSet class provides a set of setter methods, similar to those provided by the PreparedStatement interface, for setting values of each data type. A RowSet object stores the parameter values internally, and its execute method uses them internally to set values for the placeholder parameters before it sends the command to the DBMS to be executed.

The following code fragment demonstrates setting the two parameters in the query from the previous example.

crs.setInt(1, 5000);
   crs.setString(2, "West");
If the execute method is called at this point, the query sent to the DBMS will be:
"SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +
                  "WHERE CREDIT_LIMIT > 5000 AND REGION = 'West'"
NOTE: Setting Array, Clob, Blob and Ref objects as a command parameter, stores these values as SerialArray, SerialClob, SerialBlob and SerialRef objects respectively.

4.0 Handling of Parameters Behind the Scenes

Note

The BaseRowSet class provides two kinds of setter methods, those that set properties and those that set placeholder parameters. The setter methods discussed in this section are those that set placeholder parameters.

The placeholder parameters set with the BaseRowSet setter methods are stored as objects in an internal Hashtable object. Primitives are stored as their Object type. For example, byte is stored as Byte object, and int is stored as an Integer object. When the method execute is called, the values in the Hashtable object are substituted for the appropriate placeholder parameters in the command.

A call to the method getParams returns the values stored in the Hashtable object as an array of Object instances. An element in this array may be a simple Object instance or an array (which is a type of Object). The particular setter method used determines whether an element in this array is an Object or an array.

The majority of methods for setting placeholder parameters take two parameters, with the first parameter indicating which placeholder parameter is to be set, and the second parameter giving the value to be set. Methods such as setInt, setString, setBoolean, and setLong fall into this category. After these methods have been called, a call to the method getParams will return an array with the values that have been set. Each element in the array is an Object instance representing the values that have been set. The order of these values in the array is determined by the int (the first parameter) passed to the setter method. The values in the array are the values (the second parameter) passed to the setter method. In other words, the first element in the array is the value to be set for the first placeholder parameter in the RowSet object's command. The second element is the value to be set for the second placeholder parameter, and so on.

Several setter methods send the driver and DBMS information beyond the value to be set. When the method getParams is called after one of these setter methods has been used, the elements in the array will themselves be arrays to accommodate the additional information. In this category, the method setNull is a special case because one version takes only two parameters (setNull(int parameterIndex, int SqlType)). Nevertheless, it requires an array to contain the information that will be passed to the driver and DBMS. The first element in this array is the value to be set, which is null, and the second element is the int supplied for sqlType, which indicates the type of SQL value that is being set to null. This information is needed by some DBMSs and is therefore required in order to ensure that applications are portable. The other version is intended to be used when the value to be set to null is a user-defined type. It takes three parameters (setNull(int parameterIndex, int sqlType, String typeName)) and also requires an array to contain the information to be passed to the driver and DBMS. The first two elements in this array are the same as for the first version of setNull. The third element, typeName, gives the SQL name of the user-defined type. As is true with the other setter methods, the number of the placeholder parameter to be set is indicated by an element's position in the array returned by getParams. So, for example, if the parameter supplied to setNull is 2, the second element in the array returned by getParams will be an array of two or three elements.

Some methods, such as setObject and setDate have versions that take more than two parameters, with the extra parameters giving information to the driver or the DBMS. For example, the methods setDate, setTime, and setTimestamp can take a Calendar object as their third parameter. If the DBMS does not store time zone information, the driver uses the Calendar object to construct the Date, Time, or Timestamp object being set. As is true with other methods that provide additional information, the element in the array returned by getParams is an array instead of a simple Object instance.

The methods setAsciiStream, setBinaryStream, setCharacterStream, and setUnicodeStream (which is deprecated, so applications should use getCharacterStream instead) take three parameters, so for them, the element in the array returned by getParams is also an array. What is different about these setter methods is that in addition to the information provided by parameters, the array contains one of the BaseRowSet constants indicating the type of stream being set.

Note

The method getParams is called internally by RowSet implementations extending this class; it is not normally called by an application programmer directly.

5.0 Event Notification

The BaseRowSet class provides the event notification mechanism for rowsets. It contains the field listeners, methods for adding and removing listeners, and methods for notifying listeners of changes.

A listener is an object that has implemented the RowSetListener interface. If it has been added to a RowSet object's list of listeners, it will be notified when an event occurs on that RowSet object. Each listener's implementation of the RowSetListener methods defines what that object will do when it is notified that an event has occurred.

There are three possible events for a RowSet object:

  1. the cursor moves
  2. an individual row is changed (updated, deleted, or inserted)
  3. the contents of the entire RowSet object are changed

The BaseRowSet method used for the notification indicates the type of event that has occurred. For example, the method notifyRowChanged indicates that a row has been updated, deleted, or inserted. Each of the notification methods creates a RowSetEvent object, which is supplied to the listener in order to identify the RowSet object on which the event occurred. What the listener does with this information, which may be nothing, depends on how it was implemented.

6.0 Default Behavior

A default BaseRowSet object is initialized with many starting values. The following is true of a default RowSet instance that extends the BaseRowSet class:

If other values are desired, an application must set the property values explicitly. For example, the following line of code sets the maximum number of rows for the CachedRowSet object crs to 500.

   crs.setMaxRows(500);
Methods implemented in extensions of this BaseRowSet class must throw an SQLException object for any violation of the defined assertions. Also, if the extending class overrides and reimplements any BaseRowSet method and encounters connectivity or underlying data source issues, that method may in addition throw an SQLException object for that reason.
Since
1.5

Field Summary

Modifier and TypeField and Description
public static final int
ASCII_STREAM_PARAM

A constant indicating to a RowSetReaderImpl object that a given parameter is an ASCII stream.

protected InputStream
asciiStream

The InputStream object that will be returned by the method getAsciiStream, which is specified in the ResultSet interface.

public static final int
BINARY_STREAM_PARAM

A constant indicating to a RowSetReaderImpl object that a given parameter is a binary stream.

protected InputStream
binaryStream

The InputStream object that will be returned by the method getBinaryStream, which is specified in the ResultSet interface.

protected Reader
charStream

The Reader object that will be returned by the method getCharacterStream, which is specified in the ResultSet interface.

private String
command

The query that will be sent to the DBMS for execution when the method execute is called.

private int
concurrency

A constant indicating the concurrency of this JDBC RowSet object.

private String
dataSource

The logical name of the data source that the reader/writer should use in order to retrieve a DataSource object from a Java Directory and Naming Interface (JNDI) naming service.

private boolean
escapeProcessing

A boolean indicating whether the reader for this JDBC RowSet object should perform escape processing.

private int
fetchDir

A constant used as a hint to the driver that indicates the direction in which data from this JDBC RowSet object is going to be fetched.

private int
fetchSize

A hint to the driver that indicates the expected number of rows in this JDBC RowSet object .

private int
isolation

A constant indicating the isolation level of the connection for this JDBC RowSet object .

private Vector<RowSetListener>
listeners

A Vector object that holds the list of listeners that have registered with this RowSet object.

private Map<String, Class<?>>
map

The java.util.Map object that contains entries mapping SQL type names to classes in the Java programming language for the custom mapping of user-defined types.

private int
maxFieldSize

The maximum field size the reader should read.

private int
maxRows

The maximum number of rows the reader should read.

private Hashtable<Integer, Object>
params

A Vector object that holds the parameters set for this RowSet object's current command.

private transient String
password

The password the reader, writer, or both supply to the method DriverManager.getConnection when the DriverManager is used to get a connection.

private int
queryTimeout

The maximum number of seconds the driver will wait for a command to execute.

private boolean
readOnly

A boolean indicating whether this JDBC RowSet object is read-only.

private int
rowSetType

A constant indicating the type of this JDBC RowSet object.

pack-priv static final long
private boolean
showDeleted

A boolean indicating whether deleted rows are visible in this JDBC RowSet object .

public static final int
UNICODE_STREAM_PARAM

A constant indicating to a RowSetReaderImpl object that a given parameter is a Unicode stream.

protected InputStream
unicodeStream

The InputStream object that will be returned by the method getUnicodeStream, which is specified in the ResultSet interface.

private String
URL

The JDBC URL the reader, writer, or both supply to the method DriverManager.getConnection when the DriverManager is used to get a connection.

private transient String
username

The user name the reader, writer, or both supply to the method DriverManager.getConnection when the DriverManager is used to get a connection.

Constructor Summary

AccessConstructor and Description
public
BaseRowSet()

Constructs a new BaseRowSet object initialized with a default Vector object for its listeners field.

Method Summary

Modifier and TypeMethod and Description
public void
addRowSetListener(RowSetListener
an object that has implemented the javax.sql.RowSetListener interface and wants to be notified of any events that occur on this RowSet object; May be null.
listener
)

The listener will be notified whenever an event occurs on this RowSet object.

private void
checkforRowSetInterface()

Determine if instance of this class extends the RowSet interface.

private void
checkParamIndex(int
an int indicating which parameter is to be checked; the first parameter is 1
idx
)

Checks the given index to see whether it is less than 1 and throws an SQLException object if it is.

public void
clearParameters()

Clears all of the current parameter values in this RowSet object's internal representation of the parameters to be set in this RowSet object's command when it is executed.

public String

Returns:

the String that is the value for this RowSet object's command property; may be null
getCommand
()

Retrieves the SQL query that is the command for this RowSet object.

public int

Returns:

the concurrency type for this RowSet object, which must be one of the following: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
getConcurrency
()

Returns the concurrency for this RowSet object.

public String

Returns:

a String object that identifies the DataSource object to be used for making a connection; if no logical name has been set, null is returned.
getDataSourceName
()

Returns the logical name that when supplied to a naming service that uses the Java Naming and Directory Interface (JNDI) API, will retrieve a javax.sql.DataSource object.

public boolean

Returns:

true if escape processing is turned on; false otherwise
getEscapeProcessing
()

Ascertains whether escape processing is enabled for this RowSet object.

public int

Returns:

one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN
getFetchDirection
()

Retrieves this RowSet object's current setting for the fetch direction.

public int

Returns:

the number of rows suggested as the fetch size when this RowSet object needs more rows from the database
getFetchSize
()

Returns the fetch size for this RowSet object.

public int

Returns:

an int indicating the current maximum column size limit; zero means that there is no limit
getMaxFieldSize
()

Retrieves the maximum number of bytes that can be used for a column value in this RowSet object.

public int

Returns:

an int indicating the current maximum number of rows; zero means that there is no limit
getMaxRows
()

Retrieves the maximum number of rows that this RowSet object may contain.

public Object[]

Returns:

an array of Object instances that includes the parameter values that may be set in this RowSet object's command; an empty array if no parameters have been set
getParams
()

Retrieves an array containing the parameter values (both Objects and primitives) that have been set for this RowSet object's command and throws an SQLException object if all parameters have not been set.

public String

Returns:

the String object that represents the password that must be supplied to the database to create a connection
getPassword
()

Returns the password used to create a database connection for this RowSet object.

public int

Returns:

the current query timeout limit in seconds; zero means that there is no limit
getQueryTimeout
()

Retrieves the maximum number of seconds the driver will wait for a query to execute.

public boolean

Returns:

true if deleted rows are visible; false otherwise
getShowDeleted
()

Retrieves a boolean indicating whether rows marked for deletion appear in the set of current rows.

public int

Returns:

one of the following constants: Connection.TRANSACTION_NONE, Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE
getTransactionIsolation
()

Returns the transaction isolation property for this RowSet object's connection.

public int

Returns:

the type of this JDBC RowSet object, which must be one of the following: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
getType
()

Returns the type of this RowSet object.

public Map<String, Class<?>>

Returns:

the java.util.Map object that is the type map for this RowSet object's connection
getTypeMap
()

Retrieves the type map associated with the Connection object for this RowSet object.

public String

Returns:

a String object that contains the JDBC URL used to establish the connection for this RowSet object; may be null (default value) if not set
getUrl
()

Retrieves the JDBC URL that this RowSet object's javax.sql.Reader object uses to make a connection with a relational database using a JDBC technology-enabled driver.

public String

Returns:

the String object containing the user name that is supplied to the data source to create a connection; may be null (default value) if not set
getUsername
()

Returns the user name used to create a database connection.

protected void
initParams()

Performs the necessary internal configurations and initializations to allow any JDBC RowSet implementation to start using the standard facilities provided by a BaseRowSet instance.

public boolean

Returns:

true if this RowSet object cannot be updated; false otherwise
isReadOnly
()

Returns a boolean indicating whether this RowSet object is read-only.

protected void
notifyCursorMoved()

Notifies all of the listeners registered with this RowSet object that its cursor has moved.

protected void
notifyRowChanged()

Notifies all of the listeners registered with this RowSet object that one of its rows has changed.

protected void
notifyRowSetChanged()

Notifies all of the listeners registered with this RowSet object that its entire contents have changed.

public void
removeRowSetListener(RowSetListener
a RowSetListener object that is on the list of listeners for this RowSet object
listener
)

Removes the designated object from this RowSet object's list of listeners.

public void
setArray(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Array
an Array object representing an SQL ARRAY value; cannot be null. The Array object passed to this method must return a non-null Object for all getArray() method calls. A null value will cause a SQLException to be thrown.
array
)

Sets the designated parameter to an Array object in the Java programming language.

public void
setAsciiStream(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
InputStream
the Java input stream that contains the ASCII parameter value
x
,
int
the number of bytes in the stream. This is the number of bytes the driver will send to the DBMS; lengths of 0 or less are are undefined but will cause an invalid length exception to be thrown in the underlying JDBC driver.
length
)

Sets the designated parameter to the given java.io.InputStream object, which will have the specified number of bytes.

public void
setAsciiStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the Java input stream that contains the ASCII parameter value
x
)

Sets the designated parameter in this RowSet object's command to the given input stream.

public void
setAsciiStream(String
the name of the parameter
parameterName
,
InputStream
the Java input stream that contains the ASCII parameter value
x
,
int
the number of bytes in the stream
length
)

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public void
setAsciiStream(String
the name of the parameter
parameterName
,
InputStream
the Java input stream that contains the ASCII parameter value
x
)

Sets the designated parameter to the given input stream.

public void
setBigDecimal(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
BigDecimal
the parameter value
x
)

Sets the designated parameter to the given java.math.BigDecimal value.

public void
setBigDecimal(String
the name of the parameter
parameterName
,
BigDecimal
the parameter value
x
)

Sets the designated parameter to the given java.math.BigDecimal value.

public void
setBinaryStream(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
InputStream
the input stream that contains the binary value to be set
x
,
int
the number of bytes in the stream; lengths of 0 or less are are undefined but will cause an invalid length exception to be thrown in the underlying JDBC driver.
length
)

Sets the designated parameter to the given java.io.InputStream object, which will have the specified number of bytes.

public void
setBinaryStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
the java input stream which contains the binary parameter value
x
)

Sets the designated parameter in this RowSet object's command to the given input stream.

public void
setBinaryStream(String
the name of the parameter
parameterName
,
InputStream
the java input stream which contains the binary parameter value
x
,
int
the number of bytes in the stream
length
)

Sets the designated parameter to the given input stream, which will have the specified number of bytes.

public void
setBinaryStream(String
the name of the parameter
parameterName
,
InputStream
the java input stream which contains the binary parameter value
x
)

Sets the designated parameter to the given input stream.

public void
setBlob(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Blob
a Blob object representing an SQL BLOB value
x
)

Sets the designated parameter to the given Blob object in the Java programming language.

public void
setBlob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
An object that contains the data to set the parameter value to.
inputStream
,
long
the number of bytes in the parameter data.
length
)

Sets the designated parameter to a InputStream object.

public void
setBlob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
InputStream
An object that contains the data to set the parameter value to.
inputStream
)

Sets the designated parameter to a InputStream object.

public void
setBlob(String
the name of the parameter to be set the second is 2, ...
parameterName
,
InputStream
An object that contains the data to set the parameter value to.
inputStream
,
long
the number of bytes in the parameter data.
length
)

Sets the designated parameter to a InputStream object.

public void
setBlob(String
the name of the parameter
parameterName
,
Blob
a Blob object that maps an SQL BLOB value
x
)

Sets the designated parameter to the given java.sql.Blob object.

public void
setBlob(String
the name of the parameter
parameterName
,
InputStream
An object that contains the data to set the parameter value to.
inputStream
)

Sets the designated parameter to a InputStream object.

public void
setBoolean(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
boolean
the parameter value
x
)

Sets the designated parameter to the given boolean in the Java programming language.

public void
setBoolean(String
the name of the parameter
parameterName
,
boolean
the parameter value
x
)

Sets the designated parameter to the given Java boolean value.

public void
setByte(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
byte
the parameter value
x
)

Sets the designated parameter to the given byte in the Java programming language.

public void
setByte(String
the name of the parameter
parameterName
,
byte
the parameter value
x
)

Sets the designated parameter to the given Java byte value.

public void
setBytes(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
byte[]
the parameter value
x
)

Sets the designated parameter to the given array of bytes.

public void
setBytes(String
the name of the parameter
parameterName
,
byte[]
the parameter value
x
)

Sets the designated parameter to the given Java array of bytes.

public void
setCharacterStream(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Reader
the Reader object that contains the Unicode data
reader
,
int
the number of characters in the stream; lengths of 0 or less are undefined but will cause an invalid length exception to be thrown in the underlying JDBC driver.
length
)

Sets the designated parameter to the given java.io.Reader object, which will have the specified number of characters.

public void
setCharacterStream(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the java.io.Reader object that contains the Unicode data
reader
)

Sets the designated parameter in this RowSet object's command to the given Reader object.

public void
setCharacterStream(String
the name of the parameter
parameterName
,
Reader
the java.io.Reader object that contains the UNICODE data used as the designated parameter
reader
,
int
the number of characters in the stream
length
)

Sets the designated parameter to the given Reader object, which is the given number of characters long.

public void
setCharacterStream(String
the name of the parameter
parameterName
,
Reader
the java.io.Reader object that contains the Unicode data
reader
)

Sets the designated parameter to the given Reader object.

public void
setClob(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Clob
a Clob object representing an SQL CLOB value; cannot be null
x
)

Sets the designated parameter to the given Clob object in the Java programming language.

public void
setClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
,
long
the number of characters in the parameter data.
length
)

Sets the designated parameter to a Reader object.

public void
setClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
)

Sets the designated parameter to a Reader object.

public void
setClob(String
the name of the parameter to be set
parameterName
,
Reader
An object that contains the data to set the parameter value to.
reader
,
long
the number of characters in the parameter data.
length
)

Sets the designated parameter to a Reader object.

public void
setClob(String
the name of the parameter
parameterName
,
Clob
a Clob object that maps an SQL CLOB value
x
)

Sets the designated parameter to the given java.sql.Clob object.

public void
setClob(String
the name of the parameter
parameterName
,
Reader
An object that contains the data to set the parameter value to.
reader
)

Sets the designated parameter to a Reader object.

public void
setCommand(String
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
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.

public void
setConcurrency(int
one of the following constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
concurrency
)

Sets the concurrency for this RowSet object to the specified concurrency.

public void
setDataSourceName(String
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
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.

public void
setDate(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Date
the parameter value
x
)

Sets the designated parameter to the given java.sql.Date value.

public void
setDate(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Date
a java.sql.Date object representing an SQL DATE value
x
,
Calendar
a java.util.Calendar object to use when when constructing the date
cal
)

Sets the designated parameter to the given java.sql.Date object.

public void
setDate(String
the name of the parameter
parameterName
,
Date
the parameter value
x
)

Sets the designated parameter to the given java.sql.Date value using the default time zone of the virtual machine that is running the application.

public void
setDate(String
the name of the parameter
parameterName
,
Date
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the date
cal
)

Sets the designated parameter to the given java.sql.Date value, using the given Calendar object.

public void
setDouble(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
double
the parameter value
x
)

Sets the designated parameter to the given double in the Java programming language.

public void
setDouble(String
the name of the parameter
parameterName
,
double
the parameter value
x
)

Sets the designated parameter to the given Java double value.

public void
setEscapeProcessing(boolean
true to enable escape processing; false to disable it
enable
)

Sets to the given boolean whether or not the driver will scan for escape syntax and do escape substitution before sending SQL statements to the database.

public void
setFetchDirection(int
one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN
direction
)

Gives the driver a performance hint as to the direction in which the rows in this RowSet object will be processed.

public void
setFetchSize(int
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)
rows
)

Sets the fetch size for this RowSet object to the given number of rows.

public void
setFloat(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
float
the parameter value
x
)

Sets the designated parameter to the given float in the Java programming language.

public void
setFloat(String
the name of the parameter
parameterName
,
float
the parameter value
x
)

Sets the designated parameter to the given Java float value.

public void
setInt(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
int
the parameter value
x
)

Sets the designated parameter to an int in the Java programming language.

public void
setInt(String
the name of the parameter
parameterName
,
int
the parameter value
x
)

Sets the designated parameter to the given Java int value.

public void
setLong(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
long
the parameter value
x
)

Sets the designated parameter to the given long in the Java programming language.

public void
setLong(String
the name of the parameter
parameterName
,
long
the parameter value
x
)

Sets the designated parameter to the given Java long value.

public void
setMaxFieldSize(int
an int indicating the new maximum column size limit; zero means that there is no limit
max
)

Sets the maximum number of bytes that can be used for a column value in this RowSet object to the given number.

public void
setMaxRows(int
an int indicating the current maximum number of rows; zero means that there is no limit
max
)

Sets the maximum number of rows that this RowSet object may contain to the given number.

public void
setNCharacterStream(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the parameter value
value
)

Sets the designated parameter in this RowSet object's command to a Reader object.

public void
setNCharacterStream(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
the parameter value
value
,
long
the number of characters in the parameter data.
length
)

Sets the designated parameter to a Reader object.

public void
setNCharacterStream(String
the name of the column to be set
parameterName
,
Reader
the parameter value
value
,
long
the number of characters in the parameter data.
length
)

Sets the designated parameter to a Reader object.

public void
setNCharacterStream(String
the name of the parameter
parameterName
,
Reader
the parameter value
value
)

Sets the designated parameter to a Reader object.

public void
setNClob(String
the name of the column to be set
parameterName
,
NClob
the parameter value
value
)

Sets the designated parameter to a java.sql.NClob object.

public void
setNClob(String
the name of the parameter to be set
parameterName
,
Reader
An object that contains the data to set the parameter value to.
reader
,
long
the number of characters in the parameter data.
length
)

Sets the designated parameter to a Reader object.

public void
setNClob(String
the name of the parameter
parameterName
,
Reader
An object that contains the data to set the parameter value to.
reader
)

Sets the designated parameter to a Reader object.

public void
setNClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
,
long
the number of characters in the parameter data.
length
)

Sets the designated parameter to a Reader object.

public void
setNClob(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
NClob
the parameter value
value
)

Sets the designated parameter to a java.sql.NClob object.

public void
setNClob(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
Reader
An object that contains the data to set the parameter value to.
reader
)

Sets the designated parameter to a Reader object.

public void
setNString(int
of the first parameter is 1, the second is 2, ...
parameterIndex
,
String
the parameter value
value
)

Sets the designated parameter to the given String object.

public void
setNString(String
the name of the column to be set
parameterName
,
String
the parameter value
value
)

Sets the designated parameter to the given String object.

public void
setNull(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
int
an int that is one of the SQL type codes defined in the class java.sql.Types. If a non-standard sqlType is supplied, this method will not throw a SQLException. This allows implicit support for non-standard SQL types.
sqlType
)

Sets the designated parameter to SQL NULL.

public void
setNull(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
int
a value from java.sql.Types
sqlType
,
String
the fully qualified name of an SQL user-defined type, which is ignored if the parameter is not a user-defined type or REF value
typeName
)

Sets the designated parameter to SQL NULL.

public void
setNull(String
the name of the parameter
parameterName
,
int
the SQL type code defined in java.sql.Types
sqlType
)

Sets the designated parameter to SQL NULL.

public void
setNull(String
the name of the parameter
parameterName
,
int
a value from java.sql.Types
sqlType
,
String
the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a user-defined type or SQL REF value
typeName
)

Sets the designated parameter to SQL NULL.

public void
setObject(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Object
the Object containing the input parameter value; must be an Object type
x
,
int
the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type. If a non-standard targetSqlType is supplied, this method will not throw a SQLException. This allows implicit support for non-standard SQL types.
targetSqlType
,
int
for the types java.sql.Types.DECIMAL and java.sql.Types.NUMERIC, this is the number of digits after the decimal point. For all other types, this value will be ignored.
scale
)

Sets the designated parameter to an Object in the Java programming language.

public void
setObject(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Object
the Object containing the input parameter value; must be an Object type
x
,
int
the SQL type (as defined in java.sql.Types) to be sent to the database. If a non-standard targetSqlType is supplied, this method will not throw a SQLException. This allows implicit support for non-standard SQL types.
targetSqlType
)

Sets the value of the designated parameter with the given Object value.

public void
setObject(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Object
the object containing the input parameter value
x
)

Sets the designated parameter to an Object in the Java programming language.

public void
setObject(String
the name of the parameter
parameterName
,
Object
the object containing the input parameter value
x
,
int
the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
targetSqlType
,
int
for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, this is the number of digits after the decimal point. For all other types, this value will be ignored.
scale
)

Sets the value of the designated parameter with the given object.

public void
setObject(String
the name of the parameter
parameterName
,
Object
the object containing the input parameter value
x
,
int
the SQL type (as defined in java.sql.Types) to be sent to the database
targetSqlType
)

Sets the value of the designated parameter with the given object.

public void
setObject(String
the name of the parameter
parameterName
,
Object
the object containing the input parameter value
x
)

Sets the value of the designated parameter with the given object.

public void
setPassword(String
the String object that represents the password that is supplied to the database to create a connection. It may be null.
pass
)

Sets the password used to create a database connection for this RowSet object to the given String object.

public void
setQueryTimeout(int
the new query time-out limit in seconds; zero means that there is no limit; must not be less than zero
seconds
)

Sets to the given number the maximum number of seconds the driver will wait for a query to execute.

public void
setReadOnly(boolean
true to indicate that this RowSet object is read-only; false to indicate that it is updatable
value
)

Sets this RowSet object's readOnly property to the given boolean.

public void
setRef(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Ref
a Ref object representing an SQL REF value; cannot be null
ref
)

Sets the designated parameter to the given Ref object in the Java programming language.

public void
setRowId(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
RowId
the parameter value
x
)

Sets the designated parameter to the given java.sql.RowId object.

public void
setRowId(String
the name of the parameter
parameterName
,
RowId
the parameter value
x
)

Sets the designated parameter to the given java.sql.RowId object.

public void
setShort(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
short
the parameter value
x
)

Sets the designated parameter to the given short in the Java programming language.

public void
setShort(String
the name of the parameter
parameterName
,
short
the parameter value
x
)

Sets the designated parameter to the given Java short value.

public void
setShowDeleted(boolean
true if deleted rows should be shown; false otherwise
value
)

Sets the property showDeleted to the given boolean value, which determines whether rows marked for deletion appear in the set of current rows.

public void
setSQLXML(int
index of the first parameter is 1, the second is 2, ...
parameterIndex
,
SQLXML
a SQLXML object that maps an SQL XML value
xmlObject
)

Sets the designated parameter to the given java.sql.SQLXML object.

public void
setSQLXML(String
the name of the parameter
parameterName
,
SQLXML
a SQLXML object that maps an SQL XML value
xmlObject
)

Sets the designated parameter to the given java.sql.SQLXML object.

public void
setString(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
String
the parameter value
x
)

Sets the designated parameter to the given String value.

public void
setString(String
the name of the parameter
parameterName
,
String
the parameter value
x
)

Sets the designated parameter to the given Java String value.

public void
setTime(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Time
a java.sql.Time object, which is to be set as the value for placeholder parameter parameterIndex
x
)

Sets the designated parameter to the given java.sql.Time value.

public void
setTime(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Time
a java.sql.Time object
x
,
Calendar
the java.util.Calendar object the driver can use to construct the time
cal
)

Sets the designated parameter to the given java.sql.Time object.

public void
setTime(String
the name of the parameter
parameterName
,
Time
the parameter value
x
)

Sets the designated parameter to the given java.sql.Time value.

public void
setTime(String
the name of the parameter
parameterName
,
Time
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the time
cal
)

Sets the designated parameter to the given java.sql.Time value, using the given Calendar object.

public void
setTimestamp(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Timestamp
a java.sql.Timestamp object
x
)

Sets the designated parameter to the given java.sql.Timestamp value.

public void
setTimestamp(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
Timestamp
a java.sql.Timestamp object
x
,
Calendar
the java.util.Calendar object the driver can use to construct the timestamp
cal
)

Sets the designated parameter to the given java.sql.Timestamp object.

public void
setTimestamp(String
the name of the parameter
parameterName
,
Timestamp
the parameter value
x
)

Sets the designated parameter to the given java.sql.Timestamp value.

public void
setTimestamp(String
the name of the parameter
parameterName
,
Timestamp
the parameter value
x
,
Calendar
the Calendar object the driver will use to construct the timestamp
cal
)

Sets the designated parameter to the given java.sql.Timestamp value, using the given Calendar object.

public void
setTransactionIsolation(int
one of the following constants, listed in ascending order: Connection.TRANSACTION_NONE, Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE
level
)

Sets the transaction isolation property for this JDBC RowSet object to the given constant.

public void
setType(int
one of the following constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
type
)

Sets the type for this RowSet object to the specified type.

public void
setTypeMap(Map<String, Class<?>>
a java.util.Map object that contains the mapping from SQL type names for user defined types (UDT) to classes in the Java programming language. Each entry in the Map object consists of the fully qualified SQL name of a UDT and the Class object for the SQLData implementation of that UDT. May be null.
map
)

Installs the given java.util.Map object as the type map associated with the Connection object for this RowSet object.

public void
setUnicodeStream(int
the ordinal number of the placeholder parameter in this RowSet object's command that is to be set. The first parameter is 1, the second is 2, and so on; must be 1 or greater
parameterIndex
,
InputStream
the java.io.InputStream object that contains the UNICODE parameter value
x
,
int
the number of bytes in the input stream
length
)
Deprecated getCharacterStream should be used in its place

Sets the designated parameter to the given java.io.InputStream object, which will have the specified number of bytes.

public void
setUrl(String
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
url
)

Sets the Url property for this RowSet object to the given String object and sets the dataSource name property to null.

public void
setURL(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
URL
the java.net.URL object to be set
x
)

Sets the designated parameter to the given java.net.URL value.

public void
setUsername(String
the String object containing the user name that is supplied to the data source to create a connection. It may be null.
name
)

Sets the username property for this RowSet object to the given user name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait