java.lang.Object javax.sql.rowset.BaseRowSet
public abstract class BaseRowSet
An abstract class providing a RowSet object with its basic functionality. The basic functions include having properties and sending event notifications, which all JavaBeans TM components must implement.
The BaseRowSet class provides the following:
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 TM (JNDI) API. This registration is usually done by a person acting in the capacity of a system administrator.
The following code fragment illustrates how the CachedRowSet TM 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.
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 getInt, getString, getBoolean, and getLong 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 drivern 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.
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:
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.
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.
Field Summary | |
---|---|
static 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. |
static 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. |
static 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. |
Constructor Summary | |
---|---|
BaseRowSet
() Constructs a new BaseRowSet object initialized with a default Vector object for its listeners field. |
Method Summary | |
---|---|
void |
addRowSetListener
(
RowSetListener
listener) The listener will be notified whenever an event occurs on this RowSet object. |
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. |
String |
getCommand
() Retrieves the SQL query that is the command for this RowSet object. |
int |
getConcurrency
() Returns the concurrency for this RowSet object. |
String |
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. |
boolean |
getEscapeProcessing
() Ascertains whether escape processing is enabled for this RowSet object. |
int |
getFetchDirection
() Retrieves this RowSet object's current setting for the fetch direction. |
int |
getFetchSize
() Returns the fetch size for this RowSet object. |
int |
getMaxFieldSize
() Retrieves the maximum number of bytes that can be used for a column value in this RowSet object. |
int |
getMaxRows
() Retrieves the maximum number of rows that this RowSet object may contain. |
Object [] |
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. |
String |
getPassword
() Returns the password used to create a database connection for this RowSet object. |
int |
getQueryTimeout
() Retrieves the maximum number of seconds the driver will wait for a query to execute. |
boolean |
getShowDeleted
() Retrieves a boolean indicating whether rows marked for deletion appear in the set of current rows. |
int |
getTransactionIsolation
() Returns the transaction isolation property for this RowSet object's connection. |
int |
getType
() Returns the type of this RowSet object. |
Map < String , Class <?>> |
getTypeMap
() Retrieves the type map associated with the Connection object for this RowSet object. |
String |
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. |
String |
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. |
boolean |
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. |
void |
removeRowSetListener
(
RowSetListener
listener) Removes the designated object from this RowSet object's list of listeners. |
void |
setArray
(int parameterIndex,
Array
array) Sets the designated parameter to an Array object in the Java programming language. |
void |
setAsciiStream
(int parameterIndex,
InputStream
Sets the designated parameter in this RowSet object's command to the given input stream. |
void |
setAsciiStream
(int parameterIndex,
InputStream
x, int length) Sets the designated parameter to the given java.io.InputStream object, which will have the specified number of bytes. |
void |
setAsciiStream
(
String
parameterName,
InputStream
Sets the designated parameter to the given input stream. |
void |
setAsciiStream
(
String
parameterName,
InputStream
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setBigDecimal
(int parameterIndex,
BigDecimal
x) Sets the designated parameter to the given java.lang.BigDecimal value. |
void |
setBigDecimal
(
String
parameterName,
BigDecimal
Sets the designated parameter to the given java.math.BigDecimal value. |
void |
setBinaryStream
(int parameterIndex,
InputStream
Sets the designated parameter in this RowSet object's command to the given input stream. |
void |
setBinaryStream
(int parameterIndex,
InputStream
x, int length) Sets the designated parameter to the given java.io.InputStream object, which will have the specified number of bytes. |
void |
setBinaryStream
(
String
parameterName,
InputStream
Sets the designated parameter to the given input stream. |
void |
setBinaryStream
(
String
parameterName,
InputStream
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
void |
setBlob
(int parameterIndex,
Blob
x) Sets the designated parameter to the given Blob object in the Java programming language. |
void |
setBlob
(int parameterIndex,
InputStream
Sets the designated parameter to a InputStream object. |
void |
setBlob
(int parameterIndex,
InputStream
Sets the designated parameter to a InputStream object. |
void |
setBlob
(
String
parameterName,
Blob
Sets the designated parameter to the given java.sql.Blob object. |
void |
setBlob
(
String
parameterName,
InputStream
Sets the designated parameter to a InputStream object. |
void |
setBlob
(
String
parameterName,
InputStream
Sets the designated parameter to a InputStream object. |
void |
setBoolean
(int parameterIndex, boolean x) Sets the designated parameter to the given boolean in the Java programming language. |
void |
setBoolean
(
String
Sets the designated parameter to the given Java boolean value. |
void |
setByte
(int parameterIndex, byte x) Sets the designated parameter to the given byte in the Java programming language. |
void |
setByte
(
String
Sets the designated parameter to the given Java byte value. |
void |
setBytes
(int parameterIndex, byte[] x) Sets the designated parameter to the given array of bytes. |
void |
setBytes
(
String
Sets the designated parameter to the given Java array of bytes. |
void |
setCharacterStream
(int parameterIndex,
Reader
Sets the designated parameter in this RowSet object's command to the given Reader object. |
void |
setCharacterStream
(int parameterIndex,
Reader
reader, int length) Sets the designated parameter to the given java.io.Reader object, which will have the specified number of characters. |
void |
setCharacterStream
(
String
parameterName,
Reader
Sets the designated parameter to the given Reader object. |
void |
setCharacterStream
(
String
parameterName,
Reader
Sets the designated parameter to the given Reader object, which is the given number of characters long. |
void |
setClob
(int parameterIndex,
Clob
x) Sets the designated parameter to the given Clob object in the Java programming language. |
void |
setClob
(int parameterIndex,
Reader
Sets the designated parameter to a Reader object. |
void |
setClob
(int parameterIndex,
Reader
Sets the designated parameter to a Reader object. |
void |
setClob
(
String
parameterName,
Clob
Sets the designated parameter to the given java.sql.Clob object. |
void |
setClob
(
String
parameterName,
Reader
Sets the designated parameter to a Reader object. |
void |
setClob
(
String
parameterName,
Reader
Sets the designated parameter to a Reader object. |
void |
setCommand
(
String
cmd) Sets this RowSet object's command property to the given String object and clears the parameters, if any, that were set for the previous command. |
void |
setConcurrency
(int concurrency) Sets the concurrency for this RowSet object to the specified concurrency. |
void |
setDataSourceName
(
String
name) Sets the DataSource name property for this RowSet object to the given logical name and sets this RowSet object's Url property to null. |
void |
setDate
(int parameterIndex,
Date
x) Sets the designated parameter to the given java.sql.Date value. |
void |
setDate
(int parameterIndex,
Date
x,
Calendar
cal) Sets the designated parameter to the given java.sql.Date object. |
void |
setDate
(
String
parameterName,
Date
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. |
void |
setDate
(
String
parameterName,
Date
x,
Calendar
Sets the designated parameter to the given java.sql.Date value, using the given Calendar object. |
void |
setDouble
(int parameterIndex, double x) Sets the designated parameter to the given double in the Java programming language. |
void |
setDouble
(
String
Sets the designated parameter to the given Java double value. |
void |
setEscapeProcessing
(boolean 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. |
void |
setFetchDirection
(int direction) Gives the driver a performance hint as to the direction in which the rows in this RowSet object will be processed. |
void |
setFetchSize
(int rows) Sets the fetch size for this RowSet object to the given number of rows. |
void |
setFloat
(int parameterIndex, float x) Sets the designated parameter to the given float in the Java programming language. |
void |
setFloat
(
String
Sets the designated parameter to the given Java float value. |
void |
setInt
(int parameterIndex, int x) Sets the designated parameter to an int in the Java programming language. |
void |
setInt
(
String
Sets the designated parameter to the given Java int value. |
void |
setLong
(int parameterIndex, long x) Sets the designated parameter to the given long in the Java programming language. |
void |
setLong
(
String
Sets the designated parameter to the given Java long value. |
void |
setMaxFieldSize
(int max) Sets the maximum number of bytes that can be used for a column value in this RowSet object to the given number. |
void |
setMaxRows
(int max) Sets the maximum number of rows that this RowSet object may contain to the given number. |
void |
setNCharacterStream
(int parameterIndex,
Reader
Sets the designated parameter in this RowSet object's command to a Reader object. |
void |
setNCharacterStream
(int parameterIndex,
Reader
Sets the designated parameter to a Reader object. |
void |
setNCharacterStream
(
String
parameterName,
Reader
Sets the designated parameter to a Reader object. |
void |
setNCharacterStream
(
String
parameterName,
Reader
Sets the designated parameter to a Reader object. |
void |
setNClob
(int parameterIndex,
NClob
Sets the designated parameter to a java.sql.NClob object. |
void |
setNClob
(int parameterIndex,
Reader
Sets the designated parameter to a Reader object. |
void |
setNClob
(int parameterIndex,
Reader
Sets the designated parameter to a Reader object. |
void |
setNClob
(
String
parameterName,
NClob
Sets the designated parameter to a java.sql.NClob object. |
void |
setNClob
(
String
parameterName,
Reader
Sets the designated parameter to a Reader object. |
void |
setNClob
(
String
parameterName,
Reader
Sets the designated parameter to a Reader object. |
void |
setNString
(int parameterIndex,
String
Sets the designated paramter to the given String object. |
void |
setNString
(
String
parameterName,
String
Sets the designated paramter to the given String object. |
void |
setNull
(int parameterIndex, int sqlType) Sets the designated parameter to SQL NULL. |
void |
setNull
(int parameterIndex, int sqlType,
String
typeName) Sets the designated parameter to SQL NULL. |
void |
setNull
(
String
Sets the designated parameter to SQL NULL. |
void |
setNull
(
String
parameterName, int sqlType,
String
Sets the designated parameter to SQL NULL. |
void |
setObject
(int parameterIndex,
Object
x) Sets the designated parameter to an Object in the Java programming language. |
void |
setObject
(int parameterIndex,
Object
x, int targetSqlType) Sets the value of the designated parameter with the given Object value. |
void |
setObject
(int parameterIndex,
Object
x, int targetSqlType, int scale) Sets the designated parameter to an Object in the Java programming language. |
void |
setObject
(
String
parameterName,
Object
Sets the value of the designated parameter with the given object. |
void |
setObject
(
String
parameterName,
Object
Sets the value of the designated parameter with the given object. |
void |
setObject
(
String
parameterName,
Object
Sets the value of the designated parameter with the given object. |
void |
setPassword
(
String
pass) Sets the password used to create a database connection for this RowSet object to the given String object. |
void |
setQueryTimeout
(int seconds) Sets to the given number the maximum number of seconds the driver will wait for a query to execute. |
void |
setReadOnly
(boolean value) Sets this RowSet object's readOnly property to the given boolean. |
void |
setRef
(int parameterIndex,
Ref
ref) Sets the designated parameter to the given Ref object in the Java programming language. |
void |
setRowId
(int parameterIndex,
RowId
Sets the designated parameter to the given java.sql.RowId object. |
void |
setRowId
(
String
parameterName,
RowId
Sets the designated parameter to the given java.sql.RowId object. |
void |
setShort
(int parameterIndex, short x) Sets the designated parameter to the given short in the Java programming language. |
void |
setShort
(
String
Sets the designated parameter to the given Java short value. |
void |
setShowDeleted
(boolean value) Sets the property showDeleted to the given boolean value, which determines whether rows marked for deletion appear in the set of current rows. |
void |
setSQLXML
(int parameterIndex,
SQLXML
Sets the designated parameter to the given java.sql.SQLXML object. |
void |
setSQLXML
(
String
parameterName,
SQLXML
Sets the designated parameter to the given java.sql.SQLXML object. |
void |
setString
(int parameterIndex,
String
x) Sets the designated parameter to the given String value. |
void |
setString
(
String
parameterName,
String
Sets the designated parameter to the given Java String value. |
void |
setTime
(int parameterIndex,
Time
x) Sets the designated parameter to the given java.sql.Time value. |
void |
setTime
(int parameterIndex,
Time
x,
Calendar
cal) Sets the designated parameter to the given java.sql.Time object. |
void |
setTime
(
String
parameterName,
Time
Sets the designated parameter to the given java.sql.Time value. |
void |
setTime
(
String
parameterName,
Time
x,
Calendar
Sets the designated parameter to the given java.sql.Time value, using the given Calendar object. |
void |
setTimestamp
(int parameterIndex,
Timestamp
x) Sets the designated parameter to the given java.sql.Timestamp value. |
void |
setTimestamp
(int parameterIndex,
Timestamp
x,
Calendar
cal) Sets the designated parameter to the given java.sql.Timestamp object. |
void |
setTimestamp
(
String
parameterName,
Timestamp
Sets the designated parameter to the given java.sql.Timestamp value. |
void |
setTimestamp
(
String
parameterName,
Timestamp
x,
Calendar
Sets the designated parameter to the given java.sql.Timestamp value, using the given Calendar object. |
void |
setTransactionIsolation
(int level) Sets the transaction isolation property for this JDBC RowSet object to the given constant. |
void |
setType
(int type) Sets the type for this RowSet object to the specified type. |
void |
setTypeMap
(
Map
<
String
,
Class
<?>> map) Installs the given java.util.Map object as the type map associated with the Connection object for this RowSet object. |
void |
setUnicodeStream
(int parameterIndex,
InputStream
x, int length) Deprecated. getCharacterStream should be used in its place |
void |
setURL
(int parameterIndex,
URL
Sets the designated parameter to the given java.net.URL value. |
void |
setUrl
(
String
url) Sets the Url property for this RowSet object to the given String object and sets the dataSource name property to null. |
void |
setUsername
(
String
name) Sets the username property for this RowSet object to the given user name. |
Methods inherited from class java.lang. Object |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Field Detail |
---|
public static final int UNICODE_STREAM_PARAM
public static final int BINARY_STREAM_PARAM
public static final int ASCII_STREAM_PARAM
protected InputStream binaryStream
protected InputStream unicodeStream
protected InputStream asciiStream
protected Reader charStream
Constructor Detail |
---|
public BaseRowSet()
Method Detail |
---|
protected void initParams()
public void addRowSetListener(RowSetListener listener)
A listener might, for example, be a table or graph that needs to be updated in order to accurately reflect the current state of the RowSet object.
Note : if the RowSetListener object is null, this method silently discards the null value and does not add a null reference to the set of listeners.
Note : if the listener is already set, and the new RowSetListerner instance is added to the set of listeners already registered to receive event notifications from this RowSet.
public void removeRowSetListener(RowSetListener listener)
protected void notifyCursorMoved() throws SQLException
When an application calls a method to move the cursor, that method moves the cursor and then calls this method internally. An application should never invoke this method directly.
protected void notifyRowChanged() throws SQLException
When an application calls a method that changes a row, such as the CachedRowSet methods insertRow, updateRow, or deleteRow, that method calls notifyRowChanged internally. An application should never invoke this method directly.
protected void notifyRowSetChanged() throws SQLException
When an application calls methods that change the entire contents of the RowSet object, such as the CachedRowSet methods execute, populate, restoreOriginal, or release, that method calls notifyRowSetChanged internally (either directly or indirectly). An application should never invoke this method directly.
public String getCommand()
The SQL query returned by this method is used by RowSet methods such as execute and populate, which may be implemented by any class that extends the BaseRowSet abstract class and implements one or more of the standard JSR-114 RowSet interfaces.
The command is used by the RowSet object's reader to obtain a ResultSet object. The reader then reads the data from the ResultSet object and uses it to to populate this RowSet object.
The default value for the command property is null.
public void setCommand(String cmd) throws SQLException
The command property may not be needed if the RowSet object gets its data from a source that does not support commands, such as a spreadsheet or other tabular file. Thus, this property is optional and may be null.
public String getUrl() throws SQLException
The Url property will be null if the underlying data source is a non-SQL data source, such as a spreadsheet or an XML data source.
public void setUrl(String url) throws SQLException
Setting the Url property is optional if connections are established using a DataSource object instead of the DriverManager. The driver will use either the URL property or the dataSourceName property to create a connection, whichever was specified most recently. If an application uses a JDBC URL, it must load a JDBC driver that accepts the JDBC URL before it uses the RowSet object to connect to a database. The RowSet object will use the URL internally to create a database connection in order to read or write data.
public String getDataSourceName()
Users should set either the url or the data source name property. The driver will use the property set most recently to establish a connection.
public void setDataSourceName(String name) throws SQLException
Users should set either the Url property or the dataSourceName property. If both properties are set, the driver will use the property set most recently.
public String getUsername()
public void setUsername(String name)
public String getPassword()
public void setPassword(String pass)
public void setType(int type) throws SQLException
public int getType() throws SQLException
public void setConcurrency(int concurrency) throws SQLException
public boolean isReadOnly()
public void setReadOnly(boolean value)
public int getTransactionIsolation()
For RowSet implementations such as the CachedRowSet that operate in a disconnected environment, the SyncProvider object offers complementary locking and data integrity options. The options described below are pertinent only to connected RowSet objects (JdbcRowSet objects).
public void setTransactionIsolation(int level) throws SQLException
For RowSet implementations such as the CachedRowSet that operate in a disconnected environment, the SyncProvider object being used offers complementary locking and data integrity options. The options described below are pertinent only to connected RowSet objects (JdbcRowSet objects).
public Map<String,Class<?>> getTypeMap()
Drivers that support the JDBC 3.0 API will create Connection objects with an associated type map. This type map, which is initially empty, can contain one or more fully-qualified SQL names and Class objects indicating the class to which the named SQL value will be mapped. The type mapping specified in the connection's type map is used for custom type mapping when no other type map supersedes it.
If a type map is explicitly supplied to a method that can perform custom mapping, that type map supersedes the connection's type map.
public void setTypeMap(Map<String,Class<?>> map)
public int getMaxFieldSize() throws SQLException
public void setMaxFieldSize(int max) throws SQLException
public int getMaxRows() throws SQLException
public void setMaxRows(int max) throws SQLException
public void setEscapeProcessing(boolean enable) throws SQLException
Note: Since PreparedStatement objects have usually been parsed prior to making this call, disabling escape processing for prepared statements will likely have no effect.
public int getQueryTimeout() throws SQLException
public void setQueryTimeout(int seconds) throws SQLException
public boolean getShowDeleted() throws SQLException
Note: Allowing deleted rows to remain visible complicates the behavior of some of the methods. However, most RowSet object users can simply ignore this extra detail because only sophisticated applications will likely want to take advantage of this feature.
public void setShowDeleted(boolean value) throws SQLException
public boolean getEscapeProcessing() throws SQLException
public void setFetchDirection(int direction) throws SQLException
A RowSet object inherits the default properties of the ResultSet object from which it got its data. That ResultSet object's default fetch direction is set by the Statement object that created it.
This method applies to a RowSet object only while it is connected to a database using a JDBC driver.
A RowSet object may use this method at any time to change its setting for the fetch direction.
public int getFetchDirection() throws SQLException
public void setFetchSize(int rows) throws SQLException
A RowSet object inherits the default properties of the ResultSet object from which it got its data. That ResultSet object's default fetch size is set by the Statement object that created it.
This method applies to a RowSet object only while it is connected to a database using a JDBC driver. For connected RowSet implementations such as JdbcRowSet, this method has a direct and immediate effect on the underlying JDBC driver.
A RowSet object may use this method at any time to change its setting for the fetch size.
For RowSet implementations such as CachedRowSet, which operate in a disconnected environment, the SyncProvider object being used may leverage the fetch size to poll the data source and retrieve a number of rows that do not exceed the fetch size and that may form a subset of the actual rows returned by the original query. This is an implementation variance determined by the specific SyncProvider object employed by the disconnected RowSet object.
public int getFetchSize() throws SQLException
public int getConcurrency() throws SQLException
An application can call the method setConcurrency at any time to change a RowSet object's concurrency.
public void setNull(int parameterIndex, int sqlType) throws SQLException
Note that the second parameter tells the DBMS the data type of the value being set to NULL. Some DBMSs require this information, so it is required in order to make code more portable.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setNull has been called will return an Object array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is null. The second element is the value set for sqlType . The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the second placeholder parameter is being set to null, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is parameterIndex -1.
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException
Note: To be portable, applications must give the SQL type code and the fully qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-defined 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 technology-enabled driver does not need the type code or type name information, it may ignore it.
If the parameter does not have a user-defined or REF type, the given typeName parameter is ignored.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setNull has been called will return an Object array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is null. The second element is the value set for sqlType , and the third element is the value set for typeName . The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the second placeholder parameter is being set to null, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is parameterIndex -1.
public void setBoolean(int parameterIndex, boolean x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute, populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setByte(int parameterIndex, byte x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setShort(int parameterIndex, short x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setInt(int parameterIndex, int x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setLong(int parameterIndex, long x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setFloat(int parameterIndex, float x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setDouble(int parameterIndex, double x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class. S
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
Note: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setString(int parameterIndex, String x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setBytes(int parameterIndex, byte[] x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
public void setDate(int parameterIndex, Date x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setDate has been called will return an array with the value to be set for placeholder parameter number parameterIndex being the Date object supplied as the second parameter. Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is parameterIndex -1.
public void setTime(int parameterIndex, Time x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of the method setTime has been called will return an array of the parameters that have been set. The parameter to be set for parameter placeholder number parameterIndex will be the Time object that was set as the second parameter to this method.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is parameterIndex -1.
public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setTimestamp has been called will return an array with the value for parameter placeholder number parameterIndex being the Timestamp object that was supplied as the second parameter to this method. Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is parameterIndex -1.
public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException
When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream object. A JDBC technology-enabled driver will read the data from the stream as needed until it reaches end-of-file. The driver will do any necessary conversion from ASCII to the database CHAR format.
Note: This stream object can be either a standard Java stream object or your own subclass that implements the standard interface.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
Note: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after setAsciiStream has been called will return an array containing the parameter values that have been set. The element in the array that represents the values set with this method will itself be an array. The first element of that array is the given java.io.InputStream object. The second element is the value set for length . The third element is an internal BaseRowSet constant specifying that the stream passed to this method is an ASCII stream. The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the input stream being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setAsciiStream (int parameterIndex, InputStream x) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setAsciiStream which takes a length parameter.
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException
When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream object. A JDBC technology-enabled driver will read the data from the stream as needed until it reaches end-of-file.
Note: This stream object can be either a standard Java stream object or your own subclass that implements the standard interface.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after setBinaryStream has been called will return an array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is the given java.io.InputStream object. The second element is the value set for length . The third element is an internal BaseRowSet constant specifying that the stream passed to this method is a binary stream. The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the input stream being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setBinaryStream (int parameterIndex, InputStream x) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setBinaryStream which takes a length parameter.
public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
When a very large Unicode value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream object. A JDBC technology-enabled driver will read the data from the stream as needed, until it reaches end-of-file. The driver will do any necessary conversion from Unicode to the database CHAR format. The byte format of the Unicode stream must be Java UTF-8, as defined in the Java Virtual Machine Specification.
Note: This stream object can be either a standard Java stream object or your own subclass that implements the standard interface.
This method is deprecated; the method getCharacterStream should be used in its place.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Calls made to the method getParams after setUnicodeStream has been called will return an array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is the given java.io.InputStream object. The second element is the value set for length . The third element is an internal BaseRowSet constant specifying that the stream passed to this method is a Unicode stream. The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the input stream being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException
When a very large Unicode value is input to a LONGVARCHAR parameter, it may be more practical to send it via a Reader object. A JDBC technology-enabled driver will read the data from the stream as needed until it reaches end-of-file. The driver will do any necessary conversion from Unicode to the database CHAR format. The byte format of the Unicode stream must be Java UTF-8, as defined in the Java Virtual Machine Specification.
Note: This stream object can be either a standard Java stream object or your own subclass that implements the standard interface.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after setCharacterStream has been called will return an array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is the given java.io.Reader object. The second element is the value set for length . The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the reader being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setCharacterStream (int parameterIndex, Reader reader) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setCharacterStream which takes a length parameter.
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
The driver converts this object to the specified target SQL type before sending it to the database. If the object has a custom mapping (is of a class implementing SQLData), the driver should call the method SQLData.writeSQL to write the object to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, Struct, or Array, the driver should pass it to the database as a value of the corresponding SQL type.
Note that this method may be used to pass database- specific abstract data types.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setObject has been called will return an array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is the given Object instance, and the second element is the value set for targetSqlType . The third element is the value set for scale , which the driver will ignore if the type of the object being set is not java.sql.Types.NUMERIC or java.sql.Types.DECIMAL. The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the object being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setObject has been called will return an array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is the given Object instance. The second element is the value set for targetSqlType . The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the object being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setObject(int parameterIndex, Object x) throws SQLException
The JDBC specification defines a standard mapping from Java Object types to SQL types. The driver will use this standard mapping to convert the given object to its corresponding SQL type before sending it to the database. If the object has a custom mapping (is of a class implementing SQLData), the driver should call the method SQLData.writeSQL to write the object to the SQL data stream.
If, on the other hand, the object is of a class implementing Ref, Blob, Clob, Struct, or Array, the driver should pass it to the database as a value of the corresponding SQL type.
This method throws an exception if there is an ambiguity, for example, if the object is of a class implementing more than one interface.
Note that this method may be used to pass database-specific abstract data types.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
After this method has been called, a call to the method getParams will return an object array of the current command parameters, which will include the Object set for placeholder parameter number parameterIndex. Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setRef(int parameterIndex, Ref ref) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
After this method has been called, a call to the method getParams will return an object array of the current command parameters, which will include the Ref object set for placeholder parameter number parameterIndex. Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setBlob(int parameterIndex, Blob x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces. NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
After this method has been called, a call to the method getParams will return an object array of the current command parameters, which will include the Blob object set for placeholder parameter number parameterIndex. Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setClob(int parameterIndex, Clob x) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
After this method has been called, a call to the method getParams will return an object array of the current command parameters, which will include the Clob object set for placeholder parameter number parameterIndex. Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setArray(int parameterIndex, Array array) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
Note: JdbcRowSet does not require the populate method as it is undefined in this class.
After this method has been called, a call to the method getParams will return an object array of the current command parameters, which will include the Array object set for placeholder parameter number parameterIndex. Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is element number parameterIndex -1.
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setDate has been called will return an array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is the given java.sql.Date object. The second element is the value set for cal . The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the date being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is parameterIndex -1.
public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException
When the DBMS does not store time zone information, the driver will use the given Calendar object to construct the SQL TIME value to send to the database. With a Calendar object, the driver can calculate the date taking into account a custom time zone. If no Calendar object is specified, the driver uses the time zone of the Virtual Machine that is running the application.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setTime has been called will return an array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is the given java.sql.Time object. The second element is the value set for cal . The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the time being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is parameterIndex -1.
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException
When the DBMS does not store time zone information, the driver will use the given Calendar object to construct the SQL TIMESTAMP value to send to the database. With a Calendar object, the driver can calculate the timestamp taking into account a custom time zone. If no Calendar object is specified, the driver uses the time zone of the Virtual Machine that is running the application.
The parameter value set by this method is stored internally and will be supplied as the appropriate parameter in this RowSet object's command when the method execute is called. Methods such as execute and populate must be provided in any class that extends this class and implements one or more of the standard JSR-114 RowSet interfaces.
NOTE: JdbcRowSet does not require the populate method as it is undefined in this class.
Calls made to the method getParams after this version of setTimestamp has been called will return an array containing the parameter values that have been set. In that array, the element that represents the values set with this method will itself be an array. The first element of that array is the given java.sql.Timestamp object. The second element is the value set for cal . The parameter number is indicated by an element's position in the array returned by the method getParams, with the first element being the value for the first placeholder parameter, the second element being the value for the second placeholder parameter, and so on. In other words, if the timestamp being set is the value for the second placeholder parameter, the array containing it will be the second element in the array returned by getParams.
Note that because the numbering of elements in an array starts at zero, the array element that corresponds to placeholder parameter number parameterIndex is parameterIndex -1.
public void clearParameters() throws SQLException
In general, parameter values remain in force for repeated use in this RowSet object's command. Setting a parameter value with the setter methods automatically clears the value of the designated parameter and replaces it with the new specified value.
This method is called internally by the setCommand method to clear all of the parameters set for the previous command.
Furthermore, this method differs from the initParams method in that it maintains the schema of the RowSet object.
public Object[] getParams() throws SQLException
Each element in the array that is returned is an Object instance that contains the values of the parameters supplied to a setter method. The order of the elements is determined by the value supplied for parameterIndex . If the setter method takes only the parameter index and the value to be set (possibly null), the array element will contain the value to be set (which will be expressed as an Object). If there are additional parameters, the array element will itself be an array containing the value to be set plus any additional parameter values supplied to the setter method. If the method sets a stream, the array element includes the type of stream being supplied to the method. These additional parameters are for the use of the driver or the DBMS and may or may not be used.
NOTE: Stored parameter values of types Array, Blob, Clob and Ref are returned as SerialArray, SerialBlob, SerialClob and SerialRef respectively.
public void setNull ( String parameterName, int sqlType) throws SQLException
Note: You must specify the parameter's SQL type.
public void setNull ( String parameterName, int sqlType, String typeName) throws SQLException
Note: To be portable, applications must give the SQL type code and the fully-qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-defined 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-defined 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-defined or REF type, the given typeName is ignored.
public void setBoolean ( String parameterName, boolean x) throws SQLException
public void setByte ( String parameterName, byte x) throws SQLException
public void setShort ( String parameterName, short x) throws SQLException
public void setInt ( String parameterName, int x) throws SQLException
public void setLong ( String parameterName, long x) throws SQLException
public void setFloat ( String parameterName, float x) throws SQLException
public void setDouble ( String parameterName, double x) throws SQLException
public void setBigDecimal ( String parameterName, BigDecimal x) throws SQLException
public void setString ( String parameterName, String x) throws SQLException
public void setBytes ( String parameterName, byte[] x) throws SQLException
public void setTimestamp ( String parameterName, Timestamp x) throws SQLException
public void setAsciiStream ( String parameterName, InputStream x, int length) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
public void setBinaryStream ( String parameterName, InputStream x, int length) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
public void setCharacterStream ( String parameterName, Reader reader, int length) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
public void setAsciiStream ( String parameterName, InputStream x) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setAsciiStream which takes a length parameter.
public void setBinaryStream ( String parameterName, InputStream x) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setBinaryStream which takes a length parameter.
public void setCharacterStream ( String parameterName, Reader reader) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setCharacterStream which takes a length parameter.
public void setNCharacterStream (int parameterIndex, Reader value) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setNCharacterStream which takes a length parameter.
public void setObject ( String parameterName, Object x, int targetSqlType, int scale) throws SQLException
The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, NClob, Struct, java.net.URL, or Array, the driver should 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.
public void setObject ( String parameterName, Object x, int targetSqlType) throws SQLException
public void setObject ( String parameterName, Object x) throws SQLException
The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument 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 the interface SQLData, the JDBC driver should call the method SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, NClob, Struct, java.net.URL, or Array, the driver should pass it to the database as a value of the corresponding SQL type.
This method throws an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of the interfaces named above.
public void setBlob (int parameterIndex, InputStream inputStream, long length) throws SQLException
public void setBlob (int parameterIndex, InputStream inputStream) throws SQLException
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setBlob which takes a length parameter.
public void setBlob ( String parameterName, InputStream inputStream, long length) throws SQLException
public void setBlob ( String parameterName, Blob x) throws SQLException
public void setBlob ( String parameterName, InputStream inputStream) throws SQLException
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setBlob which takes a length parameter.
public void setClob (int parameterIndex, Reader reader, long length) throws SQLException
public void setClob (int parameterIndex, Reader reader) throws SQLException
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setClob which takes a length parameter.
public void setClob ( String parameterName, Reader reader, long length) throws SQLException
public void setClob ( String parameterName, Clob x) throws SQLException
public void setClob ( String parameterName, Reader reader) throws SQLException
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setClob which takes a length parameter.
public void setDate ( String parameterName, Date x) throws SQLException
public void setDate ( String parameterName, Date x, Calendar cal) throws SQLException
public void setTime ( String parameterName, Time x) throws SQLException
public void setTime ( String parameterName, Time x, Calendar cal) throws SQLException
public void setTimestamp ( String parameterName, Timestamp x, Calendar cal) throws SQLException
public void setSQLXML (int parameterIndex, SQLXML xmlObject) throws SQLException
public void setSQLXML ( String parameterName, SQLXML xmlObject) throws SQLException
public void setRowId (int parameterIndex, RowId x) throws SQLException
public void setRowId ( String parameterName, RowId x) throws SQLException
public void setNString (int parameterIndex, String value) throws SQLException
public void setNString ( String parameterName, String value) throws SQLException
public void setNCharacterStream (int parameterIndex, Reader value, long length) throws SQLException
public void setNCharacterStream ( String parameterName, Reader value, long length) throws SQLException
public void setNCharacterStream ( String parameterName, Reader value) throws SQLException
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setNCharacterStream which takes a length parameter.
public void setNClob ( String parameterName, NClob value) throws SQLException
public void setNClob ( String parameterName, Reader reader, long length) throws SQLException
public void setNClob ( String parameterName, Reader reader) throws SQLException
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setNClob which takes a length parameter.
public void setNClob (int parameterIndex, Reader reader, long length) throws SQLException
public void setNClob (int parameterIndex, NClob value) throws SQLException
public void setNClob (int parameterIndex, Reader reader) throws SQLException
Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setNClob which takes a length parameter.
public void setURL (int parameterIndex, URL x) throws SQLException