|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.5.0
javax.sql.rowset
|
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 x,
int length)
Sets the designated parameter to the given java.io.InputStream object,
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 |
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 |
setBlob(int parameterIndex,
Blob x)
Sets the designated parameter to the given Blob object in
the Java programming language. |
void |
setBoolean(int parameterIndex,
boolean x)
Sets the designated parameter to the given boolean in the
Java programming language. |
void |
setByte(int parameterIndex,
byte x)
Sets the designated parameter to the given byte in the Java
programming language. |
void |
setBytes(int parameterIndex,
byte[] x)
Sets the designated parameter to the given array of bytes. |
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 |
setClob(int parameterIndex,
Clob x)
Sets the designated parameter to the given Clob object in
the Java programming language. |
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 |
setDouble(int parameterIndex,
double x)
Sets the designated parameter to the given double in the
Java programming language. |
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 |
setInt(int parameterIndex,
int x)
Sets the designated parameter to an int in the Java
programming language. |
void |
setLong(int parameterIndex,
long x)
Sets the designated parameter to the given long in the Java
programming language. |
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 |
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 |
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 |
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 |
setShort(int parameterIndex,
short x)
Sets the designated parameter to the given short in the
Java programming language. |
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 |
setString(int parameterIndex,
String x)
Sets the designated parameter to the given 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 |
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 |
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(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
RowSetReaderImpl
object
that a given parameter is a Unicode stream. This
RowSetReaderImpl
object is provided as an extension of the
SyncProvider
abstract class defined in the
SyncFactory
static factory SPI mechanism.
public static final int BINARY_STREAM_PARAM
RowSetReaderImpl
object
that a given parameter is a binary stream. A
RowSetReaderImpl
object is provided as an extension of the
SyncProvider
abstract class defined in the
SyncFactory
static factory SPI mechanism.
public static final int ASCII_STREAM_PARAM
RowSetReaderImpl
object
that a given parameter is an ASCII stream. A
RowSetReaderImpl
object is provided as an extension of the
SyncProvider
abstract class defined in the
SyncFactory
static factory SPI mechanism.
protected InputStream binaryStream
InputStream
object that will be
returned by the method getBinaryStream
, which is
specified in the ResultSet
interface.
protected InputStream unicodeStream
InputStream
object that will be
returned by the method getUnicodeStream
,
which is specified in the ResultSet
interface.
protected InputStream asciiStream
InputStream
object that will be
returned by the method getAsciiStream
,
which is specified in the ResultSet
interface.
protected Reader charStream
Reader
object that will be
returned by the method getCharacterStream
,
which is specified in the ResultSet
interface.
Constructor Detail |
---|
public BaseRowSet()
BaseRowSet
object initialized with
a default Vector
object for its listeners
field. The other default values with which it is initialized are listed
in Section 6.0 of the class comment for this class.
Method Detail |
---|
protected void initParams()
RowSet
implementation to start using
the standard facilities provided by a BaseRowSet
instance. This method should be called after the RowSet
object
has been instantiated to correctly initialize all parameters. This method
should never be called by an application, but is called from with
a RowSet
implementation extending this class.
public void addRowSetListener(RowSetListener listener)
RowSet
object.
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
.
listener
- 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.removeRowSetListener(javax.sql.RowSetListener)
public void removeRowSetListener(RowSetListener listener)
RowSet
object's list of listeners.
If the given argument is not a registered listener, this method
does nothing.
Note: if the RowSetListener
object is
null
, this method silently discards the null
value.
listener
- a RowSetListener
object that is on the list
of listeners for this RowSet
objectaddRowSetListener(javax.sql.RowSetListener)
protected void notifyCursorMoved() throws SQLException
RowSet
object that its cursor has moved.
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.
SQLException
- if the class extending the BaseRowSet
abstract class does not implement the RowSet
interface or
one of it's sub-interfaces.protected void notifyRowChanged() throws SQLException
RowSet
object that
one of its rows has changed.
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.
SQLException
- if the class extending the BaseRowSet
abstract class does not implement the RowSet
interface or
one of it's sub-interfaces.protected void notifyRowSetChanged() throws SQLException
RowSet
object that its entire contents have changed.
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.
SQLException
- if the class extending the BaseRowSet
abstract class does not implement the RowSet
interface or
one of it's sub-interfaces.public String getCommand()
RowSet
object. The command property contains the query that
will be executed to populate this RowSet
object.
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
.
String
that is the value for this
RowSet
object's command
property;
may be null
setCommand(java.lang.String)
public void setCommand(String cmd) throws SQLException
RowSet
object's command
property to
the given String
object and clears the parameters, if any,
that were set for the previous command.
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
.
cmd
- 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
SQLException
- if an empty string is provided as the command valuegetCommand()
public String getUrl() throws SQLException
RowSet
object's
javax.sql.Reader
object uses to make a connection
with a relational database using a JDBC technology-enabled driver.
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.
String
object that contains the JDBC URL
used to establish the connection for this RowSet
object; may be null
(default value) if not set
SQLException
- if an error occurs retrieving the URL valuesetUrl(java.lang.String)
public void setUrl(String url) throws SQLException
RowSet
object
to the given String
object and sets the dataSource name
property to null
. The Url property is a
JDBC URL that is used when
the connection is created using a JDBC technology-enabled driver
("JDBC driver") and the DriverManager
.
The correct JDBC URL for the specific driver to be used can be found
in the driver documentation. Although there are guidelines for for how
a JDBC URL is formed,
a driver vendor can specify any String
object except
one with a length of 0
(an empty string).
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.
url
- 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
SQLException
- if an error occurs setting the Url property or the
parameter supplied is a string with a length of 0
(an
empty string)getUrl()
public String getDataSourceName()
javax.sql.DataSource
object. This
DataSource
object can be used to establish a connection
to the data source that it represents.
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.
String
object that identifies the
DataSource
object to be used for making a
connection; if no logical name has been set, null
is returned.setDataSourceName(java.lang.String)
public void setDataSourceName(String name) throws SQLException
DataSource
name property for this RowSet
object to the given logical name and sets this RowSet
object's
Url property to null
. The name must have been bound to a
DataSource
object in a JNDI naming service so that an
application can do a lookup using that name to retrieve the
DataSource
object bound to it. The DataSource
object can then be used to establish a connection to the data source it
represents.
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.
name
- 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
SQLException
- if an empty string is provided as the DataSource
namegetDataSourceName()
public String getUsername()
execute
.
String
object containing the user name that
is supplied to the data source to create a connection; may be
null
(default value) if not setsetUsername(java.lang.String)
public void setUsername(String name)
RowSet
object
to the given user name. Because it
is not serialized, the username property is set at run time before
calling the method execute
.
name
- the String
object containing the user name that
is supplied to the data source to create a connection. It may be null.getUsername()
public String getPassword()
RowSet
object. Because the password property is not
serialized, it is set at run time before calling the method
execute
. The default value is null
String
object that represents the password
that must be supplied to the database to create a connectionsetPassword(java.lang.String)
public void setPassword(String pass)
RowSet
object to the given String
object. Because the password property is not
serialized, it is set at run time before calling the method
execute
.
pass
- the String
object that represents the password
that is supplied to the database to create a connection. It may be
null.getPassword()
public void setType(int type) throws SQLException
RowSet
object to the specified type.
The default type is ResultSet.TYPE_SCROLL_INSENSITIVE
.
type
- one of the following constants:
ResultSet.TYPE_FORWARD_ONLY
,
ResultSet.TYPE_SCROLL_INSENSITIVE
, or
ResultSet.TYPE_SCROLL_SENSITIVE
SQLException
- if the parameter supplied is not one of the
following constants:
ResultSet.TYPE_FORWARD_ONLY
or
ResultSet.TYPE_SCROLL_INSENSITIVE
ResultSet.TYPE_SCROLL_SENSITIVE
getConcurrency()
,
getType()
public int getType() throws SQLException
RowSet
object. The type is initially
determined by the statement that created the RowSet
object.
The RowSet
object can call the method
setType
at any time to change its
type. The default is TYPE_SCROLL_INSENSITIVE
.
RowSet
object, which must be one of the following:
ResultSet.TYPE_FORWARD_ONLY
,
ResultSet.TYPE_SCROLL_INSENSITIVE
, or
ResultSet.TYPE_SCROLL_SENSITIVE
SQLException
- if an error occurs getting the type of
of this RowSet
objectsetType(int)
public void setConcurrency(int concurrency) throws SQLException
RowSet
object to
the specified concurrency. The default concurrency for any RowSet
object (connected or disconnected) is ResultSet.CONCUR_UPDATABLE
,
but this method may be called at any time to change the concurrency.
concurrency
- one of the following constants:
ResultSet.CONCUR_READ_ONLY
or
ResultSet.CONCUR_UPDATABLE
SQLException
- if the parameter supplied is not one of the
following constants:
ResultSet.CONCUR_UPDATABLE
or
ResultSet.CONCUR_READ_ONLY
getConcurrency()
,
isReadOnly()
public boolean isReadOnly()
boolean
indicating whether this
RowSet
object is read-only.
Any attempts to update a read-only RowSet
object will result in an
SQLException
being thrown. By default,
rowsets are updatable if updates are possible.
true
if this RowSet
object
cannot be updated; false
otherwisesetConcurrency(int)
,
setReadOnly(boolean)
public void setReadOnly(boolean value)
RowSet
object's readOnly property to the given boolean
.
value
- true
to indicate that this
RowSet
object is read-only;
false
to indicate that it is updatablepublic int getTransactionIsolation()
RowSet
object's connection. This property represents
the transaction isolation level requested for use in transactions.
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).
Connection.TRANSACTION_NONE
,
Connection.TRANSACTION_READ_UNCOMMITTED
,
Connection.TRANSACTION_READ_COMMITTED
,
Connection.TRANSACTION_REPEATABLE_READ
, or
Connection.TRANSACTION_SERIALIZABLE
SyncFactory
,
SyncProvider
,
setTransactionIsolation(int)
public void setTransactionIsolation(int level) throws SQLException
RowSet
object to the given
constant. The DBMS will use this transaction isolation level for
transactions if it can.
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).
level
- 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
SQLException
- if the given parameter is not one of the Connection
constantsSyncFactory
,
SyncProvider
,
getTransactionIsolation()
public Map<String,Class<?>> getTypeMap()
Connection
object for this RowSet
object.
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.
java.util.Map
object that is the type map
for this RowSet
object's connectionpublic void setTypeMap(Map<String,Class<?>> map)
java.util.Map
object as the type map
associated with the Connection
object for this
RowSet
object. The custom mapping indicated in
this type map will be used unless a different type map is explicitly
supplied to a method, in which case the type map supplied will be used.
map
- 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
.public int getMaxFieldSize() throws SQLException
RowSet
object.
This limit applies only to columns that hold values of the
following types: BINARY
, VARBINARY
,
LONGVARBINARY
, CHAR
, VARCHAR
,
and LONGVARCHAR
. If the limit is exceeded, the excess
data is silently discarded.
int
indicating the current maximum column size
limit; zero means that there is no limit
SQLException
- if an error occurs internally determining the
maximum limit of the column sizepublic void setMaxFieldSize(int max) throws SQLException
RowSet
object to the given number.
This limit applies only to columns that hold values of the
following types: BINARY
, VARBINARY
,
LONGVARBINARY
, CHAR
, VARCHAR
,
and LONGVARCHAR
. If the limit is exceeded, the excess
data is silently discarded. For maximum portability, it is advisable to
use values greater than 256.
max
- an int
indicating the new maximum column size
limit; zero means that there is no limit
SQLException
- if (1) an error occurs internally setting the
maximum limit of the column size or (2) a size of less than 0 is setpublic int getMaxRows() throws SQLException
RowSet
object may contain. If
this limit is exceeded, the excess rows are silently dropped.
int
indicating the current maximum number of
rows; zero means that there is no limit
SQLException
- if an error occurs internally determining the
maximum limit of rows that a Rowset
object can containpublic void setMaxRows(int max) throws SQLException
RowSet
object may contain to
the given number. If this limit is exceeded, the excess rows are
silently dropped.
max
- an int
indicating the current maximum number
of rows; zero means that there is no limit
SQLException
- if an error occurs internally setting the
maximum limit on the number of rows that a JDBC RowSet
object
can contain; or if max is less than 0
; or
if max is less than the fetchSize
of the
RowSet
public void setEscapeProcessing(boolean enable) throws SQLException
boolean
whether or not the driver will
scan for escape syntax and do escape substitution before sending SQL
statements to the database. The default is for the driver to do escape
processing.
Note: Since PreparedStatement
objects have usually been
parsed prior to making this call, disabling escape processing for
prepared statements will likely have no effect.
enable
- true
to enable escape processing;
false
to disable it
SQLException
- if an error occurs setting the underlying JDBC
technology-enabled driver to process the escape syntaxpublic int getQueryTimeout() throws SQLException
SQLException
is thrown.
SQLException
- if an error occurs in determining the query
time-out valuepublic void setQueryTimeout(int seconds) throws SQLException
SQLException
is thrown.
seconds
- the new query time-out limit in seconds; zero means that
there is no limit; must not be less than zero
SQLException
- if an error occurs setting the query
time-out or if the query time-out value is less than 0public boolean getShowDeleted() throws SQLException
boolean
indicating whether rows marked
for deletion appear in the set of current rows.
The default value is false
.
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.
true
if deleted rows are visible;
false
otherwise
SQLException
- if an error occurs determining if deleted rows
are visible or notsetShowDeleted(boolean)
public void setShowDeleted(boolean value) throws SQLException
showDeleted
to the given
boolean
value, which determines whether
rows marked for deletion appear in the set of current rows.
value
- true
if deleted rows should be shown;
false
otherwise
SQLException
- if an error occurs setting whether deleted
rows are visible or notgetShowDeleted()
public boolean getEscapeProcessing() throws SQLException
RowSet
object.
true
if escape processing is turned on;
false
otherwise
SQLException
- if an error occurs determining if escape
processing is enabled or not or if the internal escape
processing trigger has not been enabledpublic void setFetchDirection(int direction) throws SQLException
RowSet
object will be
processed. The driver may ignore this hint.
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.
direction
- one of ResultSet.FETCH_FORWARD
,
ResultSet.FETCH_REVERSE
, or
ResultSet.FETCH_UNKNOWN
SQLException
- if (1) the RowSet
type is
TYPE_FORWARD_ONLY
and the given fetch direction is not
FETCH_FORWARD
or (2) the given fetch direction is not
one of the following:
ResultSet.FETCH_FORWARD,
ResultSet.FETCH_REVERSE, or
ResultSet.FETCH_UNKNOWNgetFetchDirection()
public int getFetchDirection() throws SQLException
RowSet
object's current setting for the
fetch direction. The default type is ResultSet.FETCH_FORWARD
ResultSet.FETCH_FORWARD
,
ResultSet.FETCH_REVERSE
, or
ResultSet.FETCH_UNKNOWN
SQLException
- if an error occurs in determining the
current fetch direction for fetching rowssetFetchDirection(int)
public void setFetchSize(int rows) throws SQLException
RowSet
object to the given number of
rows. The fetch size gives a JDBC technology-enabled driver ("JDBC driver")
a hint as to the
number of rows that should be fetched from the database when more rows
are needed for this RowSet
object. If the fetch size specified
is zero, the driver ignores the value and is free to make its own best guess
as to what the fetch size should be.
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.
rows
- 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()
)
SQLException
- if the specified fetch size is less than 0
or more than the limit for the maximum number of rowsgetFetchSize()
public int getFetchSize() throws SQLException
RowSet
object. The default
value is zero.
RowSet
object
needs more rows from the database
SQLException
- if an error occurs determining the number of rows in the
current fetch sizesetFetchSize(int)
public int getConcurrency() throws SQLException
RowSet
object.
The default is CONCUR_UPDATABLE
for both connected and
disconnected RowSet
objects.
An application can call the method setConcurrency
at any time
to change a RowSet
object's concurrency.
RowSet
object, which must be one of the following:
ResultSet.CONCUR_READ_ONLY
or
ResultSet.CONCUR_UPDATABLE
SQLException
- if an error occurs getting the concurrency
of this RowSet
objectsetConcurrency(int)
,
isReadOnly()
public void setNull(int parameterIndex, int sqlType) throws SQLException
NULL
.
Note that the parameter's SQL type must be specified using one of the
type codes defined in java.sql.Types
. This SQL type is
specified in the second parameter.
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.
parameterIndex
- 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 greatersqlType
- an int
that is one of the SQL type codes
defined in the class Types
. If a non-standard
sqlType is supplied, this method will not throw a
SQLException
. This allows implicit support for
non-standard SQL types.
SQLException
- if a database access error occurs or the given
parameter index is out of boundsgetParams()
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException
NULL
.
Although this version of the method setNull
is intended
for user-defined
and REF
parameters, this method may be used to set a null
parameter for any JDBC type. The following are user-defined types:
STRUCT
, DISTINCT
, and JAVA_OBJECT
,
and named array types.
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.
parameterIndex
- 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 greatersqlType
- a value from java.sql.Types
typeName
- 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
SQLException
- if an error occurs or the given parameter index
is out of boundsgetParams()
public void setBoolean(int parameterIndex, boolean x) throws SQLException
boolean
in the
Java programming language. The driver converts this to an SQL
BIT
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setByte(int parameterIndex, byte x) throws SQLException
byte
in the Java
programming language. The driver converts this to an SQL
TINYINT
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setShort(int parameterIndex, short x) throws SQLException
short
in the
Java programming language. The driver converts this to an SQL
SMALLINT
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setInt(int parameterIndex, int x) throws SQLException
int
in the Java
programming language. The driver converts this to an SQL
INTEGER
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setLong(int parameterIndex, long x) throws SQLException
long
in the Java
programming language. The driver converts this to an SQL
BIGINT
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setFloat(int parameterIndex, float x) throws SQLException
float
in the
Java programming language. The driver converts this to an SQL
FLOAT
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setDouble(int parameterIndex, double x) throws SQLException
double
in the
Java programming language. The driver converts this to an SQL
DOUBLE
value when it sends it to the database.
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
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
java.lang.BigDecimal
value. The driver converts this to
an SQL NUMERIC
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setString(int parameterIndex, String x) throws SQLException
String
value. The driver converts this to an SQL
VARCHAR
or LONGVARCHAR
value
(depending on the argument's size relative to the driver's limits
on VARCHAR
values) when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setBytes(int parameterIndex, byte[] x) throws SQLException
VARBINARY
or LONGVARBINARY
value
(depending on the argument's size relative to the driver's limits
on VARBINARY
values) when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setDate(int parameterIndex, Date x) throws SQLException
java.sql.Date
value. The driver converts this to an SQL
DATE
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- the parameter value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setTime(int parameterIndex, Time x) throws SQLException
java.sql.Time
value. The driver converts this to an SQL TIME
value
when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- a java.sql.Time
object, which is to be set as the value
for placeholder parameter parameterIndex
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
java.sql.Timestamp
value.
The driver converts this to an SQL TIMESTAMP
value when it
sends it to the database.
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.
parameterIndex
- 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 greaterx
- a java.sql.Timestamp
object
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException
java.io.InputStream
object,
which will have the specified number of bytes.
The contents of the stream will be read and sent to the database.
This method throws an SQLException
object if the number of bytes
read and sent to the database is not equal to length.
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.
parameterIndex
- 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 greaterx
- the Java input stream that contains the ASCII parameter valuelength
- 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.
SQLException
- if an error occurs, the parameter index is out of bounds,
or when connected to a data source, the number of bytes the driver reads
and sends to the database is not equal to the number of bytes specified
in lengthgetParams()
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException
java.io.InputStream
object, which will have the specified number of bytes.
The contents of the stream will be read and sent to the database.
This method throws an SQLException
object if the number of bytes
read and sent to the database is not equal to length.
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.
parameterIndex
- 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 greaterx
- the input stream that contains the binary value to be setlength
- 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.
SQLException
- if an error occurs, the parameter index is out of bounds,
or when connected to a data source, the number of bytes the driver
reads and sends to the database is not equal to the number of bytes
specified in lengthgetParams()
public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
java.io.InputStream
object, which will have the specified
number of bytes. The contents of the stream will be read and sent
to the database.
This method throws an SQLException
if the number of bytes
read and sent to the database is not equal to length.
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.
parameterIndex
- 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 greaterx
- the java.io.InputStream
object that contains the
UNICODE parameter valuelength
- the number of bytes in the input stream
SQLException
- if an error occurs, the parameter index is out of bounds,
or the number of bytes the driver reads and sends to the database is
not equal to the number of bytes specified in lengthgetParams()
public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException
java.io.Reader
object, which will have the specified number of characters. The
contents of the reader will be read and sent to the database.
This method throws an SQLException
if the number of bytes
read and sent to the database is not equal to length.
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.
parameterIndex
- 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 greaterreader
- the Reader
object that contains the
Unicode datalength
- 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.
SQLException
- if an error occurs, the parameter index is out of bounds,
or when connected to a data source, the number of bytes the driver
reads and sends to the database is not equal to the number of bytes
specified in lengthgetParams()
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
Object
in the Java
programming language. The second parameter must be an
Object
type. For integral values, the
java.lang
equivalent
objects should be used. For example, use the class Integer
for an int
.
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
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, 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.
parameterIndex
- 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 greaterx
- the Object
containing the input parameter value;
must be an Object
typetargetSqlType
- 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.scale
- 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.
SQLException
- if an error occurs or the parameter index is out of boundsgetParams()
public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException
Object
value.
This method is like setObject(int parameterIndex, Object x, int
targetSqlType, int scale)
except that it assumes a scale of zero.
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.
parameterIndex
- 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 greaterx
- the Object
containing the input parameter value;
must be an Object
typetargetSqlType
- 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.
SQLException
- if an error occurs or the parameter index
is out of boundsgetParams()
public void setObject(int parameterIndex, Object x) throws SQLException
Object
in the Java
programming language. The second parameter must be an
Object
type. For integral values, the java.lang
equivalent
objects should be used. For example, use the class Integer
for an int
.
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.
parameterIndex
- 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 greaterx
- the object containing the input parameter value
SQLException
- if an error occurs the
parameter index is out of bounds, or there
is ambiguity in the implementation of the
object being setgetParams()
public void setRef(int parameterIndex, Ref ref) throws SQLException
Ref
object in
the Java programming language. The driver converts this to an SQL
REF
value when it sends it to the database. Internally, the
Ref
is represented as a SerialRef
to ensure
serializability.
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.
parameterIndex
- 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 greaterref
- a Ref
object representing an SQL REF
value; cannot be null
SQLException
- if an error occurs; the parameter index is out of
bounds or the Ref
object is null
; or
the Ref
object returns a null
base type
name.getParams()
,
SerialRef
public void setBlob(int parameterIndex, Blob x) throws SQLException
Blob
object in
the Java programming language. The driver converts this to an SQL
BLOB
value when it sends it to the database. Internally,
the Blob
is represented as a SerialBlob
to ensure serializability.
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.
parameterIndex
- 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 greaterx
- a Blob
object representing an SQL
BLOB
value
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
,
SerialBlob
public void setClob(int parameterIndex, Clob x) throws SQLException
Clob
object in
the Java programming language. The driver converts this to an SQL
CLOB
value when it sends it to the database. Internally, the
Clob
is represented as a SerialClob
to ensure
serializability.
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.
parameterIndex
- 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 greaterx
- a Clob
object representing an SQL
CLOB
value; cannot be null
SQLException
- if an error occurs; the parameter index is out of
bounds or the Clob
is nullgetParams()
,
SerialBlob
public void setArray(int parameterIndex, Array array) throws SQLException
Array
object in the
Java programming language. The driver converts this to an SQL
ARRAY
value when it sends it to the database. Internally,
the Array
is represented as a SerialArray
to ensure serializability.
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.
parameterIndex
- 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 greaterarray
- 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.
SQLException
- if an error occurs; the parameter index is out of
bounds or the ARRAY
is nullgetParams()
,
SerialArray
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException
java.sql.Date
object.
When the DBMS does not store time zone information, the driver will use
the given Calendar
object to construct the SQL DATE
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
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.
parameterIndex
- 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 greaterx
- a java.sql.Date
object representing an SQL
DATE
valuecal
- a java.util.Calendar
object to use when
when constructing the date
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException
java.sql.Time
object. The driver converts this
to an SQL TIME
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- a java.sql.Time
objectcal
- the java.util.Calendar
object the driver can use to
construct the time
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException
java.sql.Timestamp
object. The driver converts this
to an SQL TIMESTAMP
value when it sends it to the database.
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.
parameterIndex
- 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 greaterx
- a java.sql.Timestamp
objectcal
- the java.util.Calendar
object the driver can use to
construct the timestamp
SQLException
- if an error occurs or the
parameter index is out of boundsgetParams()
public void clearParameters() throws SQLException
RowSet
object's internal representation of the parameters to be set in
this RowSet
object's command when it is executed.
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.
SQLException
- if an error occurs clearing the parameterspublic Object[] getParams() throws SQLException
RowSet
object's command and throws an SQLException
object
if all parameters have not been set. Before the command is sent to the
DBMS to be executed, these parameters will be substituted
for placeholder parameters in the PreparedStatement
object
that is the command for a RowSet
implementation extending
the BaseRowSet
class.
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.
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
SQLException
- if an error occurs retrieveing the object array of
parameters of this RowSet
object or if not all parameters have
been set