GeezerVison is showing docs.oracle.com — BaseRowSet (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact3
javax.sql.rowset
Class BaseRowSet
-
-
Field Summary
Fields
| Modifier and Type |
Field |
Description |
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
Constructors
| Constructor |
Description |
BaseRowSet() |
Constructs a new BaseRowSet object initialized with
a default Vector object for its listeners
field.
|
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods
| Modifier and Type |
Method |
Description |
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) |
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 x) |
Sets the designated parameter to the given input stream.
|
void |
setAsciiStream(String parameterName,
InputStream x,
int length) |
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 x) |
Sets the designated parameter to the given
java.math.BigDecimal value.
|
void |
setBinaryStream(int parameterIndex,
InputStream x) |
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 x) |
Sets the designated parameter to the given input stream.
|
void |
setBinaryStream(String parameterName,
InputStream x,
int length) |
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 inputStream) |
Sets the designated parameter to a InputStream object.
|
void |
setBlob(int parameterIndex,
InputStream inputStream,
long length) |
Sets the designated parameter to a InputStream object.
|
void |
setBlob(String parameterName,
Blob x) |
Sets the designated parameter to the given java.sql.Blob object.
|
void |
setBlob(String parameterName,
InputStream inputStream) |
Sets the designated parameter to a InputStream object.
|
void |
setBlob(String parameterName,
InputStream inputStream,
long length) |
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 parameterName,
boolean x) |
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 parameterName,
byte x) |
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 parameterName,
byte[] x) |
Sets the designated parameter to the given Java array of bytes.
|
void |
setCharacterStream(int parameterIndex,
Reader 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 reader) |
Sets the designated parameter to the given Reader
object.
|
void |
setCharacterStream(String parameterName,
Reader reader,
int length) |
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 reader) |
Sets the designated parameter to a Reader object.
|
void |
setClob(int parameterIndex,
Reader reader,
long length) |
Sets the designated parameter to a Reader object.
|
void |
setClob(String parameterName,
Clob x) |
Sets the designated parameter to the given java.sql.Clob object.
|
void |
setClob(String parameterName,
Reader reader) |
Sets the designated parameter to a Reader object.
|
void |
setClob(String parameterName,
Reader reader,
long length) |
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 x) |
Sets the designated parameter to the given java.sql.Date value
using the default time zone of the virtual machine that is running
the application.
|
void |
setDate(String parameterName,
Date x,
Calendar cal) |
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 parameterName,
double x) |
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 parameterName,
float x) |
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 parameterName,
int x) |
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 parameterName,
long x) |
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 value) |
Sets the designated parameter in this RowSet object's command
to a Reader object.
|
void |
setNCharacterStream(int parameterIndex,
Reader value,
long length) |
Sets the designated parameter to a Reader object.
|
void |
setNCharacterStream(String parameterName,
Reader value) |
Sets the designated parameter to a Reader object.
|
void |
setNCharacterStream(String parameterName,
Reader value,
long length) |
Sets the designated parameter to a Reader object.
|
void |
setNClob(int parameterIndex,
NClob value) |
Sets the designated parameter to a java.sql.NClob object.
|
void |
setNClob(int parameterIndex,
Reader reader) |
Sets the designated parameter to a Reader object.
|
void |
setNClob(int parameterIndex,
Reader reader,
long length) |
Sets the designated parameter to a Reader object.
|
void |
setNClob(String parameterName,
NClob value) |
Sets the designated parameter to a java.sql.NClob object.
|
void |
setNClob(String parameterName,
Reader reader) |
Sets the designated parameter to a Reader object.
|
void |
setNClob(String parameterName,
Reader reader,
long length) |
Sets the designated parameter to a Reader object.
|
void |
setNString(int parameterIndex,
String value) |
Sets the designated parameter to the given String object.
|
void |
setNString(String parameterName,
String value) |
Sets the designated parameter 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 parameterName,
int sqlType) |
Sets the designated parameter to SQL NULL.
|
void |
setNull(String parameterName,
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 |
setObject(String parameterName,
Object x) |
Sets the value of the designated parameter with the given object.
|
void |
setObject(String parameterName,
Object x,
int targetSqlType) |
Sets the value of the designated parameter with the given object.
|
void |
setObject(String parameterName,
Object x,
int targetSqlType,
int scale) |
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 x) |
Sets the designated parameter to the given java.sql.RowId object.
|
void |
setRowId(String parameterName,
RowId x) |
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 parameterName,
short x) |
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 xmlObject) |
Sets the designated parameter to the given java.sql.SQLXML object.
|
void |
setSQLXML(String parameterName,
SQLXML xmlObject) |
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 x) |
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 x) |
Sets the designated parameter to the given java.sql.Time value.
|
void |
setTime(String parameterName,
Time x,
Calendar cal) |
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 x) |
Sets the designated parameter to the given java.sql.Timestamp value.
|
void |
setTimestamp(String parameterName,
Timestamp x,
Calendar cal) |
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 x) |
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
-
UNICODE_STREAM_PARAM
public static final int UNICODE_STREAM_PARAM
A constant indicating to a 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.
- See Also:
- Constant Field Values
-
BINARY_STREAM_PARAM
public static final int BINARY_STREAM_PARAM
A constant indicating to a 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.
- See Also:
- Constant Field Values
-
ASCII_STREAM_PARAM
public static final int ASCII_STREAM_PARAM
A constant indicating to a 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.
- See Also:
- Constant Field Values
-
binaryStream
protected InputStream binaryStream
The InputStream object that will be
returned by the method getBinaryStream, which is
specified in the ResultSet interface.
-
unicodeStream
protected InputStream unicodeStream
The InputStream object that will be
returned by the method getUnicodeStream,
which is specified in the ResultSet interface.
-
asciiStream
protected InputStream asciiStream
The InputStream object that will be
returned by the method getAsciiStream,
which is specified in the ResultSet interface.
-
charStream
protected Reader charStream
The Reader object that will be
returned by the method getCharacterStream,
which is specified in the ResultSet interface.
-
Method Detail
-
initParams
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. 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.
-
removeRowSetListener
public void removeRowSetListener(RowSetListener listener)
Removes the designated object from this 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.
- Parameters:
listener - a RowSetListener object that is on the list
of listeners for this RowSet object
- See Also:
addRowSetListener(javax.sql.RowSetListener)
-
getUsername
public String getUsername()
Returns the user name used to create a database connection. Because it
is not serialized, the username property is set at runtime before
calling the method execute.
- Returns:
- the
String object containing the user name that
is supplied to the data source to create a connection; may be
null (default value) if not set
- See Also:
setUsername(java.lang.String)
-
setUsername
public void setUsername(String name)
Sets the username property for this 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.
- Parameters:
name - the String object containing the user name that
is supplied to the data source to create a connection. It may be null.
- See Also:
getUsername()
-
getPassword
public String getPassword()
Returns the password used to create a database connection for this
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
- Returns:
- the
String object that represents the password
that must be supplied to the database to create a connection
- See Also:
setPassword(java.lang.String)
-
setPassword
public void setPassword(String pass)
Sets the password used to create a database connection for this
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.
- Parameters:
pass - the String object that represents the password
that is supplied to the database to create a connection. It may be
null.
- See Also:
getPassword()
-
getType
public int getType()
throws SQLException
Returns the type of this 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.
- Returns:
- the type of this JDBC
RowSet
object, which must be one of the following:
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVE
- Throws:
SQLException - if an error occurs getting the type of
of this RowSet object
- See Also:
setType(int)
-
isReadOnly
public boolean isReadOnly()
Returns a 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.
- Returns:
true if this RowSet object
cannot be updated; false otherwise
- See Also:
setConcurrency(int),
setReadOnly(boolean)
-
setTypeMap
public 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. 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.
- Parameters:
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.
-
getMaxFieldSize
public int getMaxFieldSize()
throws SQLException
Retrieves the maximum number of bytes that can be used for a column
value in this 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.
- Returns:
- an
int indicating the current maximum column size
limit; zero means that there is no limit
- Throws:
SQLException - if an error occurs internally determining the
maximum limit of the column size
-
setMaxFieldSize
public void setMaxFieldSize(int max)
throws SQLException
Sets the maximum number of bytes that can be used for a column
value in this 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.
- Parameters:
max - an int indicating the new maximum column size
limit; zero means that there is no limit
- Throws:
SQLException - if (1) an error occurs internally setting the
maximum limit of the column size or (2) a size of less than 0 is set
-
getMaxRows
public int getMaxRows()
throws SQLException
Retrieves the maximum number of rows that this RowSet object may contain. If
this limit is exceeded, the excess rows are silently dropped.
- Returns:
- an
int indicating the current maximum number of
rows; zero means that there is no limit
- Throws:
SQLException - if an error occurs internally determining the
maximum limit of rows that a Rowset object can contain
-
setMaxRows
public void setMaxRows(int max)
throws SQLException
Sets the maximum number of rows that this RowSet object may contain to
the given number. If this limit is exceeded, the excess rows are
silently dropped.
- Parameters:
max - an int indicating the current maximum number
of rows; zero means that there is no limit
- Throws:
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
-
getQueryTimeout
public int getQueryTimeout()
throws SQLException
Retrieves the maximum number of seconds the driver will wait for a
query to execute. If the limit is exceeded, an SQLException
is thrown.
- Returns:
- the current query timeout limit in seconds; zero means that
there is no limit
- Throws:
SQLException - if an error occurs in determining the query
time-out value
-
setQueryTimeout
public void setQueryTimeout(int seconds)
throws SQLException
Sets to the given number the maximum number of seconds the driver will
wait for a query to execute. If the limit is exceeded, an
SQLException is thrown.
- Parameters:
seconds - the new query time-out limit in seconds; zero means that
there is no limit; must not be less than zero
- Throws:
SQLException - if an error occurs setting the query
time-out or if the query time-out value is less than 0
-
setShowDeleted
public void setShowDeleted(boolean value)
throws SQLException
Sets the property showDeleted to the given
boolean value, which determines whether
rows marked for deletion appear in the set of current rows.
- Parameters:
value - true if deleted rows should be shown;
false otherwise
- Throws:
SQLException - if an error occurs setting whether deleted
rows are visible or not
- See Also:
getShowDeleted()
-
setUnicodeStream
@Deprecated
public void setUnicodeStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
Deprecated. getCharacterStream should be used in its place
Sets the designated parameter to the given
java.io.InputStream object, which will have the specified
number of bytes. 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.
- Parameters:
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 greater
x - the java.io.InputStream object that contains the
UNICODE parameter value
length - the number of bytes in the input stream
- Throws:
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 length
- See Also:
getParams()
-
setObject
public void setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
throws SQLException
Sets the designated parameter to an 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
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, 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.
- Parameters:
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 greater
x - the Object containing the input parameter value;
must be an Object type
targetSqlType - 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.
- Throws:
SQLException - if an error occurs or the parameter index is out of bounds
- See Also:
getParams()
-
setBoolean
public void setBoolean(String parameterName,
boolean x)
throws SQLException
Sets the designated parameter to the given Java boolean value.
The driver converts this
to an SQL BIT or BOOLEAN value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setByte
public void setByte(String parameterName,
byte x)
throws SQLException
Sets the designated parameter to the given Java byte value.
The driver converts this
to an SQL TINYINT value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setShort
public void setShort(String parameterName,
short x)
throws SQLException
Sets the designated parameter to the given Java short value.
The driver converts this
to an SQL SMALLINT value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setInt
public void setInt(String parameterName,
int x)
throws SQLException
Sets the designated parameter to the given Java int value.
The driver converts this
to an SQL INTEGER value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setLong
public void setLong(String parameterName,
long x)
throws SQLException
Sets the designated parameter to the given Java long value.
The driver converts this
to an SQL BIGINT value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setFloat
public void setFloat(String parameterName,
float x)
throws SQLException
Sets the designated parameter to the given Java float value.
The driver converts this
to an SQL FLOAT value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setDouble
public void setDouble(String parameterName,
double x)
throws SQLException
Sets the designated parameter to the given Java double value.
The driver converts this
to an SQL DOUBLE value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setBigDecimal
public void setBigDecimal(String parameterName,
BigDecimal x)
throws SQLException
Sets the designated parameter to the given
java.math.BigDecimal value.
The driver converts this to an SQL NUMERIC value when
it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setString
public void setString(String parameterName,
String x)
throws SQLException
Sets the designated parameter to the given Java 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.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setBytes
public void setBytes(String parameterName,
byte[] x)
throws SQLException
Sets the designated parameter to the given Java array of bytes.
The driver converts this to an SQL VARBINARY or
LONGVARBINARY (depending on the argument's size relative
to the driver's limits on VARBINARY values) when it sends
it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setTimestamp
public void setTimestamp(String parameterName,
Timestamp x)
throws SQLException
Sets the designated parameter to the given java.sql.Timestamp value.
The driver
converts this to an SQL TIMESTAMP value when it sends it to the
database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setObject
public void setObject(String parameterName,
Object x,
int targetSqlType,
int scale)
throws SQLException
Sets the value of the designated parameter with the given object. The second
argument must be an object type; for integral values, the
java.lang equivalent objects should be used.
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.
- Parameters:
parameterName - the name of the parameter
x - the object containing the input parameter value
targetSqlType - the SQL type (as defined in java.sql.Types) to be
sent to the database. The scale argument may further qualify this type.
scale - for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
this is the number of digits after the decimal point. For all other
types, this value will be ignored.
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if targetSqlType is
a ARRAY, BLOB, CLOB,
DATALINK, JAVA_OBJECT, NCHAR,
NCLOB, NVARCHAR, LONGNVARCHAR,
REF, ROWID, SQLXML
or STRUCT data type and the JDBC driver does not support
this data type
- Since:
- 1.4
- See Also:
Types,
getParams()
-
setObject
public void setObject(String parameterName,
Object x,
int targetSqlType)
throws SQLException
Sets the value of the designated parameter with the given object.
This method is like the method setObject
above, except that it assumes a scale of zero.
- Parameters:
parameterName - the name of the parameter
x - the object containing the input parameter value
targetSqlType - the SQL type (as defined in java.sql.Types) to be
sent to the database
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if targetSqlType is
a ARRAY, BLOB, CLOB,
DATALINK, JAVA_OBJECT, NCHAR,
NCLOB, NVARCHAR, LONGNVARCHAR,
REF, ROWID, SQLXML
or STRUCT data type and the JDBC driver does not support
this data type
- Since:
- 1.4
- See Also:
getParams()
-
setBlob
public void setBlob(int parameterIndex,
InputStream inputStream,
long length)
throws SQLException
Sets the designated parameter to a InputStream object. The inputstream must contain the number
of characters specified by length otherwise a SQLException will be
generated when the PreparedStatement is executed.
This method differs from the setBinaryStream (int, InputStream, int)
method because it informs the driver that the parameter value should be
sent to the server as a BLOB. When the setBinaryStream method is used,
the driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGVARBINARY or a BLOB
- Parameters:
parameterIndex - index of the first parameter is 1,
the second is 2, ...
inputStream - An object that contains the data to set the parameter
value to.
length - the number of bytes in the parameter data.
- Throws:
SQLException - if a database access error occurs,
this method is called on a closed PreparedStatement,
if parameterIndex does not correspond
to a parameter marker in the SQL statement, if the length specified
is less than zero or if the number of bytes in the inputstream does not match
the specified length.
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
- Since:
- 1.6
-
setBlob
public void setBlob(String parameterName,
InputStream inputStream,
long length)
throws SQLException
Sets the designated parameter to a InputStream object. The inputstream must contain the number
of characters specified by length, otherwise a SQLException will be
generated when the CallableStatement is executed.
This method differs from the setBinaryStream (int, InputStream, int)
method because it informs the driver that the parameter value should be
sent to the server as a BLOB. When the setBinaryStream method is used,
the driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGVARBINARY or a BLOB
- Parameters:
parameterName - the name of the parameter to be set
the second is 2, ...
inputStream - An object that contains the data to set the parameter
value to.
length - the number of bytes in the parameter data.
- Throws:
SQLException - if parameterIndex does not correspond
to a parameter marker in the SQL statement, or if the length specified
is less than zero; if the number of bytes in the inputstream does not match
the specified length; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.6
-
setBlob
public void setBlob(String parameterName,
Blob x)
throws SQLException
Sets the designated parameter to the given java.sql.Blob object.
The driver converts this to an SQL BLOB value when it
sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - a Blob object that maps an SQL BLOB value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.6
-
setClob
public void setClob(int parameterIndex,
Reader reader,
long length)
throws SQLException
Sets the designated parameter to a Reader object. The reader must contain the number
of characters specified by length otherwise a SQLException will be
generated when the PreparedStatement is executed.
This method differs from the setCharacterStream (int, Reader, int) method
because it informs the driver that the parameter value should be sent to
the server as a CLOB. When the setCharacterStream method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGVARCHAR or a CLOB
- Parameters:
parameterIndex - index of the first parameter is 1, the second is 2, ...
reader - An object that contains the data to set the parameter value to.
length - the number of characters in the parameter data.
- Throws:
SQLException - if a database access error occurs, this method is called on
a closed PreparedStatement, if parameterIndex does not correspond to a parameter
marker in the SQL statement, or if the length specified is less than zero.
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
- Since:
- 1.6
-
setClob
public void setClob(String parameterName,
Reader reader,
long length)
throws SQLException
Sets the designated parameter to a Reader object. The reader must contain the number
of characters specified by length otherwise a SQLException will be
generated when the CallableStatement is executed.
This method differs from the setCharacterStream (int, Reader, int) method
because it informs the driver that the parameter value should be sent to
the server as a CLOB. When the setCharacterStream method is used, the
driver may have to do extra work to determine whether the parameter
data should be send to the server as a LONGVARCHAR or a CLOB
- Parameters:
parameterName - the name of the parameter to be set
reader - An object that contains the data to set the parameter value to.
length - the number of characters in the parameter data.
- Throws:
SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the length specified is less than zero;
a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.6
-
setClob
public void setClob(String parameterName,
Clob x)
throws SQLException
Sets the designated parameter to the given java.sql.Clob object.
The driver converts this to an SQL CLOB value when it
sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - a Clob object that maps an SQL CLOB value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.6
-
setDate
public void setDate(String parameterName,
Date x)
throws SQLException
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.
The driver converts this
to an SQL DATE value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setDate
public void setDate(String parameterName,
Date x,
Calendar cal)
throws SQLException
Sets the designated parameter to the given java.sql.Date value,
using the given Calendar object. The driver uses
the Calendar object to construct an SQL DATE value,
which the driver then sends to the database. With a
a Calendar object, the driver can calculate the date
taking into account a custom timezone. If no
Calendar object is specified, the driver uses the default
timezone, which is that of the virtual machine running the application.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - the Calendar object the driver will use
to construct the date
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setTime
public void setTime(String parameterName,
Time x)
throws SQLException
Sets the designated parameter to the given java.sql.Time value.
The driver converts this
to an SQL TIME value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setTime
public void setTime(String parameterName,
Time x,
Calendar cal)
throws SQLException
Sets the designated parameter to the given java.sql.Time value,
using the given Calendar object. The driver uses
the Calendar object to construct an SQL TIME value,
which the driver then sends to the database. With a
a Calendar object, the driver can calculate the time
taking into account a custom timezone. If no
Calendar object is specified, the driver uses the default
timezone, which is that of the virtual machine running the application.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - the Calendar object the driver will use
to construct the time
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setTimestamp
public void setTimestamp(String parameterName,
Timestamp x,
Calendar cal)
throws SQLException
Sets the designated parameter to the given java.sql.Timestamp value,
using the given Calendar object. The driver uses
the Calendar object to construct an SQL TIMESTAMP value,
which the driver then sends to the database. With a
a Calendar object, the driver can calculate the timestamp
taking into account a custom timezone. If no
Calendar object is specified, the driver uses the default
timezone, which is that of the virtual machine running the application.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - the Calendar object the driver will use
to construct the timestamp
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.4
- See Also:
getParams()
-
setSQLXML
public void setSQLXML(int parameterIndex,
SQLXML xmlObject)
throws SQLException
Sets the designated parameter to the given java.sql.SQLXML object. The driver converts this to an
SQL XML value when it sends it to the database.
- Parameters:
parameterIndex - index of the first parameter is 1, the second is 2, ...
xmlObject - a SQLXML object that maps an SQL XML value
- Throws:
SQLException - if a database access error occurs, this method
is called on a closed result set,
the java.xml.transform.Result,
Writer or OutputStream has not been closed
for the SQLXML object or
if there is an error processing the XML value. The getCause method
of the exception may provide a more detailed exception, for example, if the
stream does not contain valid XML.
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setSQLXML
public void setSQLXML(String parameterName,
SQLXML xmlObject)
throws SQLException
Sets the designated parameter to the given java.sql.SQLXML object. The driver converts this to an
SQL XML value when it sends it to the database.
- Parameters:
parameterName - the name of the parameter
xmlObject - a SQLXML object that maps an SQL XML value
- Throws:
SQLException - if a database access error occurs, this method
is called on a closed result set,
the java.xml.transform.Result,
Writer or OutputStream has not been closed
for the SQLXML object or
if there is an error processing the XML value. The getCause method
of the exception may provide a more detailed exception, for example, if the
stream does not contain valid XML.
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setRowId
public void setRowId(int parameterIndex,
RowId x)
throws SQLException
Sets the designated parameter to the given java.sql.RowId object. The
driver converts this to a SQL ROWID value when it sends it
to the database
- Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value
- Throws:
SQLException - if a database access error occurs
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setRowId
public void setRowId(String parameterName,
RowId x)
throws SQLException
Sets the designated parameter to the given java.sql.RowId object. The
driver converts this to a SQL ROWID when it sends it to the
database.
- Parameters:
parameterName - the name of the parameter
x - the parameter value
- Throws:
SQLException - if a database access error occurs
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setNString
public void setNString(int parameterIndex,
String value)
throws SQLException
Sets the designated parameter to the given String object.
The driver converts this to a SQL NCHAR or
NVARCHAR or LONGNVARCHAR value
(depending on the argument's
size relative to the driver's limits on NVARCHAR values)
when it sends it to the database.
- Parameters:
parameterIndex - of the first parameter is 1, the second is 2, ...
value - the parameter value
- Throws:
SQLException - if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur ; or if a database access error occurs
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setNString
public void setNString(String parameterName,
String value)
throws SQLException
Sets the designated parameter to the given String object.
The driver converts this to a SQL NCHAR or
NVARCHAR or LONGNVARCHAR
- Parameters:
parameterName - the name of the column to be set
value - the parameter value
- Throws:
SQLException - if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; or if a database access error occurs
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex,
Reader value,
long length)
throws SQLException
Sets the designated parameter to a Reader object. The
Reader reads the data till end-of-file is reached. The
driver does the necessary conversion from Java character format to
the national character set in the database.
- Parameters:
parameterIndex - of the first parameter is 1, the second is 2, ...
value - the parameter value
length - the number of characters in the parameter data.
- Throws:
SQLException - if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur ; or if a database access error occurs
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setNCharacterStream
public void setNCharacterStream(String parameterName,
Reader value,
long length)
throws SQLException
Sets the designated parameter to a Reader object. The
Reader reads the data till end-of-file is reached. The
driver does the necessary conversion from Java character format to
the national character set in the database.
- Parameters:
parameterName - the name of the column to be set
value - the parameter value
length - the number of characters in the parameter data.
- Throws:
SQLException - if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; or if a database access error occurs
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setNClob
public void setNClob(String parameterName,
NClob value)
throws SQLException
Sets the designated parameter to a java.sql.NClob object. The object
implements the java.sql.NClob interface. This NClob
object maps to a SQL NCLOB.
- Parameters:
parameterName - the name of the column to be set
value - the parameter value
- Throws:
SQLException - if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; or if a database access error occurs
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setNClob
public void setNClob(String parameterName,
Reader reader,
long length)
throws SQLException
Sets the designated parameter to a Reader object. The reader must contain
the number
of characters specified by length otherwise a SQLException will be
generated when the CallableStatement is executed.
This method differs from the setCharacterStream (int, Reader, int) method
because it informs the driver that the parameter value should be sent to
the server as a NCLOB. When the setCharacterStream method is used, the
driver may have to do extra work to determine whether the parameter
data should be send to the server as a LONGNVARCHAR or a NCLOB
- Parameters:
parameterName - the name of the parameter to be set
reader - An object that contains the data to set the parameter value to.
length - the number of characters in the parameter data.
- Throws:
SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the length specified is less than zero;
if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support
this method
- Since:
- 1.6
-
setNClob
public void setNClob(int parameterIndex,
Reader reader,
long length)
throws SQLException
Sets the designated parameter to a Reader object. The reader must contain the number
of characters specified by length otherwise a SQLException will be
generated when the PreparedStatement is executed.
This method differs from the setCharacterStream (int, Reader, int) method
because it informs the driver that the parameter value should be sent to
the server as a NCLOB. When the setCharacterStream method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGNVARCHAR or a NCLOB
- Parameters:
parameterIndex - index of the first parameter is 1, the second is 2, ...
reader - An object that contains the data to set the parameter value to.
length - the number of characters in the parameter data.
- Throws:
SQLException - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the length specified is less than zero;
if the driver does not support national character sets;
if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed PreparedStatement
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setNClob
public void setNClob(int parameterIndex,
NClob value)
throws SQLException
Sets the designated parameter to a java.sql.NClob object. The driver converts this oa
SQL NCLOB value when it sends it to the database.
- Parameters:
parameterIndex - of the first parameter is 1, the second is 2, ...
value - the parameter value
- Throws:
SQLException - if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur ; or if a database access error occurs
SQLFeatureNotSupportedException - if the JDBC driver does not
support this method
- Since:
- 1.6
-
setURL
public void setURL(int parameterIndex,
URL x)
throws SQLException
Sets the designated parameter to the given java.net.URL value.
The driver converts this to an SQL DATALINK value
when it sends it to the database.
- Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the java.net.URL object to be set
- Throws:
SQLException - if a database access error occurs or
this method is called on a closed PreparedStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
- Since:
- 1.4
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|