|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.database.DbStatement
com.uwyn.rife.database.DbPreparedStatement
public class DbPreparedStatement
Provides a wrapper around the regular JDBC PreparedStatement
class. It can only be instantiated by calling the
getPreparedStatement method on an existing
DbConnection instance.
This class hooks into the database connection pool and cleans up as much
as possible in case of errors. The thrown DatabaseException
exceptions should thus only be used for error reporting and not for
releasing resources used by the framework.
The executeQuery method stores its resultset in the
executing DbPreparedStatement instance. It's recommended to
use the DbQueryManager's fetch method to process
the result set. If needed, one can also use the getResultSet
method to manually process the results through plain JDBC. However, when
exceptions are thrown during this procedure, it's also the responsability
of the user to correctly clean up all resources.
Additional methods have been implemented to take advantage of information that is present when one uses query builders to construct the database queries. In this case, parameter values can be set by using column names instead of column numbers and automatic population of a statement from bean property values is also supported.
executeQuery(),
DbStatement.getResultSet(),
DbConnection.getPreparedStatement(String),
DbQueryManager.fetch(ResultSet, DbRowProcessor),
Delete,
Insert,
Select,
Update,
PreparedStatement,
ResultSet| Method Summary | |
|---|---|
void |
addBatch()
Adds a set of parameters to this DbPreparedStatement
object's batch of commands. |
void |
clearParameters()
Clears the current parameter values immediately. |
void |
close()
Releases this DbPreparedStatement object's database
and JDBC resources immediately instead of waiting for this to
happen when it is automatically closed. |
void |
executeQuery()
Executes the SQL query in this DbPreparedStatement
object. |
int |
executeUpdate()
Executes the SQL statement in this DbPreparedStatement
object, which must be an SQL INSERT,
UPDATE or DELETE statement; or a SQL
statement that returns nothing, such as a DDL statement. |
ResultSetMetaData |
getMetaData()
Retrieves a ResultSetMetaData object that contains
information about the columns of the ResultSet object
that will be returned when this PDbreparedStatement
object is executed. |
int[] |
getParameterIndices(String parameterName)
Retrieves all the parameter indices that correspond to the name of a parameter of the ParametrizedQuery object that is
used by this DbPreparedStatement instance. |
ParameterMetaData |
getParameterMetaData()
Retrieves the number, types and properties of this DbPreparedStatement object's parameters. |
Query |
getQuery()
Returns the query builder that provides the SQL query that will be executed by this prepared statement. |
String |
getSql()
Returns the SQL query that will be executed by this prepared statement. |
Object |
getVirtualParameterValue(int parameterIndex)
Get the value of a specific virtual parameter. |
Object |
getVirtualParameterValue(String name)
Get the value of a specific virtual parameter. |
DbPreparedStatement |
setArray(int parameterIndex,
Array x)
Sets the designated parameter to the given Array
object. |
DbPreparedStatement |
setArray(String parameterName,
Array x)
Sets the named parameters to the given Array object. |
DbPreparedStatement |
setAsciiStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
DbPreparedStatement |
setAsciiStream(String parameterName,
InputStream x,
int length)
Sets the named parameter to the given input stream, which will have the specified number of bytes. |
DbPreparedStatement |
setBean(Object bean)
Automatically retrieves all the values of a bean's properties and sets them for the parameters that have been defined by the ParametrizedQuery object of this
DbPrepareStatement instance. |
DbPreparedStatement |
setBigDecimal(int parameterIndex,
BigDecimal x)
Sets the designated parameter to the given java.math.BigDecimal value. |
DbPreparedStatement |
setBigDecimal(String parameterName,
BigDecimal x)
Sets the named parameters to the given java.math.BigDecimal value. |
DbPreparedStatement |
setBigDecimals(int[] parameterIndices,
BigDecimal x)
Sets the designated parameters to the given java.math.BigDecimal value. |
DbPreparedStatement |
setBinaryStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
DbPreparedStatement |
setBinaryStream(String parameterName,
InputStream x,
int length)
Sets the named parameter to the given input stream, which will have the specified number of bytes. |
DbPreparedStatement |
setBlob(int parameterIndex,
Blob x)
Sets the designated parameter to the given Blob
object. |
DbPreparedStatement |
setBlob(String parameterName,
Blob x)
Sets the named parameter to the given Blob object. |
DbPreparedStatement |
setBoolean(int parameterIndex,
boolean x)
Sets the designated parameter to the given Java boolean value. |
DbPreparedStatement |
setBoolean(String parameterName,
boolean x)
Sets the named parameters to the given Java boolean
value. |
DbPreparedStatement |
setBooleans(int[] parameterIndices,
boolean x)
Sets the designated parameters to the given Java boolean value. |
DbPreparedStatement |
setByte(int parameterIndex,
byte x)
Sets the designated parameter to the given Java byte
value. |
DbPreparedStatement |
setByte(String parameterName,
byte x)
Sets the named parameters to the given Java byte
value. |
DbPreparedStatement |
setBytes(int[] parameterIndices,
byte x)
Sets the designated parameters to the given Java byte
value. |
DbPreparedStatement |
setBytes(int[] parameterIndices,
byte[] x)
Sets the designated parameters to the given Java array of bytes. |
DbPreparedStatement |
setBytes(int parameterIndex,
byte[] x)
Sets the designated parameter to the given Java array of bytes. |
DbPreparedStatement |
setBytes(String parameterName,
byte[] x)
Sets the named parameters to the given Java array of bytes. |
DbPreparedStatement |
setCharacterStream(int parameterIndex,
Reader x,
int length)
Sets the designated parameter to the given Reader
object, which is the given number of characters long. |
DbPreparedStatement |
setCharacterStream(String parameterName,
Reader x,
int length)
Sets the named parameter to the given Reader object,
which is the given number of characters long. |
DbPreparedStatement |
setClob(int parameterIndex,
Clob x)
Sets the designated parameter to the given Clob
object. |
DbPreparedStatement |
setClob(String parameterName,
Clob x)
Sets the named parameter to the given Clob object. |
DbPreparedStatement |
setDate(int parameterIndex,
Date x)
Sets the designated parameter to the given java.sql.Date value. |
DbPreparedStatement |
setDate(int parameterIndex,
Date x,
Calendar cal)
Sets the designated parameter to the given java.sql.Date value, using the given
Calendar object. |
DbPreparedStatement |
setDate(String parameterName,
Date x)
Sets the named parameters to the given java.sql.Date
value. |
DbPreparedStatement |
setDate(String parameterName,
Date x,
Calendar cal)
Sets the named parameters to the given java.sql.Date
value, using the given Calendar object. |
DbPreparedStatement |
setDates(int[] parameterIndices,
Date x)
Sets the designated parameters to the given java.sql.Date value. |
DbPreparedStatement |
setDates(int[] parameterIndices,
Date x,
Calendar cal)
Sets the designated parameters to the given java.sql.Date value, using the given
Calendar object. |
DbPreparedStatement |
setDouble(int parameterIndex,
double x)
Sets the designated parameter to the given Java double
value. |
DbPreparedStatement |
setDouble(String parameterName,
double x)
Sets the named parameters to the given Java double
value. |
DbPreparedStatement |
setDoubles(int[] parameterIndices,
double x)
Sets the designated parameters to the given Java double value. |
DbPreparedStatement |
setFloat(int parameterIndex,
float x)
Sets the designated parameter to the given Java float
value. |
DbPreparedStatement |
setFloat(String parameterName,
float x)
Sets the named parameters to the given Java float
value. |
DbPreparedStatement |
setFloats(int[] parameterIndices,
float x)
Sets the designated parameters to the given Java float
value. |
DbPreparedStatement |
setInt(int parameterIndex,
int x)
Sets the designated parameter to the given Java int
value. |
DbPreparedStatement |
setInt(String parameterName,
int x)
Sets the named parameter to the given Java int value. |
DbPreparedStatement |
setInts(int[] parameterIndices,
int x)
Sets the designated parameters to the given Java int
value. |
DbPreparedStatement |
setLong(int parameterIndex,
long x)
Sets the designated parameter to the given Java long
value. |
DbPreparedStatement |
setLong(String parameterName,
long x)
Sets the named parameters to the given Java long
value. |
DbPreparedStatement |
setLongs(int[] parameterIndices,
long x)
Sets the designated parameters to the given Java long
value. |
DbPreparedStatement |
setNull(int parameterIndex,
int sqlType)
Sets the designated parameter to SQL NULL. |
DbPreparedStatement |
setNull(int parameterIndex,
int sqlType,
String typeName)
Sets the designated parameter to SQL NULL. |
DbPreparedStatement |
setNull(String parameterName,
int sqlType)
Sets the named parameters to SQL NULL. |
DbPreparedStatement |
setNull(String parameterName,
int sqlType,
String typeName)
Sets the named parameters to SQL NULL. |
DbPreparedStatement |
setNulls(int[] parameterIndices,
int sqlType)
Sets the designated parameters to SQL NULL. |
DbPreparedStatement |
setNulls(int[] parameterIndices,
int sqlType,
String typeName)
Sets the designated parameters to SQL NULL. |
DbPreparedStatement |
setObject(int parameterIndex,
Object x)
Sets the value of the designated parameter using the given object. |
DbPreparedStatement |
setObject(int parameterIndex,
Object x,
int targetSqlType)
Sets the value of the designated parameter with the given object. |
DbPreparedStatement |
setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
Sets the value of the designated parameter with the given object. |
DbPreparedStatement |
setObject(String parameterName,
Object x)
Sets the value of the named parameters using the given object. |
DbPreparedStatement |
setObject(String parameterName,
Object x,
int targetSqlType)
Sets the value of the named parameters with the given object. |
DbPreparedStatement |
setObject(String parameterName,
Object x,
int targetSqlType,
int scale)
Sets the value of the named parameters with the given object. |
DbPreparedStatement |
setObjects(int[] parameterIndices,
Object x)
Sets the value of the designated parameters using the given object. |
DbPreparedStatement |
setObjects(int[] parameterIndices,
Object x,
int targetSqlType)
Sets the value of the designated parameters with the given object. |
DbPreparedStatement |
setObjects(int[] parameterIndices,
Object x,
int targetSqlType,
int scale)
Sets the value of the designated parameters with the given object. |
DbPreparedStatement |
setRef(int parameterIndex,
Ref x)
Sets the designated parameter to the given REF(<structured-type>) value. |
DbPreparedStatement |
setRef(String parameterName,
Ref x)
Sets the named parameter to the given REF(<structured-type>) value. |
DbPreparedStatement |
setShort(int parameterIndex,
short x)
Sets the designated parameter to the given Java short
value. |
DbPreparedStatement |
setShort(String parameterName,
short x)
Sets the named parameters to the given Java short
value. |
DbPreparedStatement |
setShorts(int[] parameterIndices,
short x)
Sets the designated parameters to the given Java short
value. |
DbPreparedStatement |
setString(int parameterIndex,
String x)
Sets the designated parameter to the given Java String
value. |
DbPreparedStatement |
setString(String parameterName,
String x)
Sets the named parameters to the given Java String
value. |
DbPreparedStatement |
setStrings(int[] parameterIndices,
String x)
Sets the designated parameters to the given Java String value. |
DbPreparedStatement |
setTime(int parameterIndex,
Time x)
Sets the designated parameter to the given java.sql.Time value. |
DbPreparedStatement |
setTime(int parameterIndex,
Time x,
Calendar cal)
Sets the designated parameter to the given java.sql.Time value, using the given
Calendar object. |
DbPreparedStatement |
setTime(String parameterName,
Time x)
Sets the named parameters to the given java.sql.Time
value. |
DbPreparedStatement |
setTime(String parameterName,
Time x,
Calendar cal)
Sets the named parameters to the given java.sql.Time
value, using the given Calendar object. |
DbPreparedStatement |
setTimes(int[] parameterIndices,
Time x)
Sets the designated parameters to the given java.sql.Time value. |
DbPreparedStatement |
setTimes(int[] parameterIndices,
Time x,
Calendar cal)
Sets the designated parameters to the given java.sql.Time value, using the given
Calendar object. |
DbPreparedStatement |
setTimestamp(int parameterIndex,
Timestamp x)
Sets the designated parameter to the given java.sql.Timestamp value. |
DbPreparedStatement |
setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal)
Sets the designated parameter to the given java.sql.Timestamp value, using the given
Calendar object. |
DbPreparedStatement |
setTimestamp(String parameterName,
Timestamp x)
Sets the named parameters to the given java.sql.Timestamp value. |
DbPreparedStatement |
setTimestamp(String parameterName,
Timestamp x,
Calendar cal)
Sets the named parameters to the given java.sql.Timestamp value, using the given
Calendar object. |
DbPreparedStatement |
setTimestamps(int[] parameterIndices,
Timestamp x)
Sets the designated parameters to the given java.sql.Timestamp value. |
DbPreparedStatement |
setTimestamps(int[] parameterIndices,
Timestamp x,
Calendar cal)
Sets the designated parameters to the given java.sql.Timestamp value, using the given
Calendar object. |
DbPreparedStatement |
setURL(int parameterIndex,
URL x)
Sets the designated parameter to the given java.net.URL value. |
DbPreparedStatement |
setURL(String parameterName,
URL x)
Sets the named parameters to the given java.net.URL
value. |
DbPreparedStatement |
setURLs(int[] parameterIndices,
URL x)
Sets the designated parameters to the given java.net.URL value. |
void |
setVirtualParameters(VirtualParameters parameters)
Sets the parameters that should be handled as virtual parameters. |
| Methods inherited from class com.uwyn.rife.database.DbStatement |
|---|
addBatch, cancel, clearBatch, clearWarnings, clone, execute, execute, execute, execute, executeBatch, executeQuery, executeQuery, executeUpdate, executeUpdate, finalize, getConnection, getFetchDirection, getFetchSize, getFirstGeneratedIntKey, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, handleException, outputTrace, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout, setResultset, startTrace, traceBatch, wasNull |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public String getSql()
String with the SQL query of this prepared
statementpublic Query getQuery()
Query object with the query builder
instance; or
null if the prepared statement was initialized from
a string SQL query
public void executeQuery()
throws DatabaseException
DbPreparedStatement
object. The ResultSet object generated by the query is
stored and can be retrieved with the getResultSet
method.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
DatabaseException - if a database access error occurs or
the SQL statement does not return a ResultSet objectDbStatement.getResultSet()
public int executeUpdate()
throws DatabaseException
DbPreparedStatement
object, which must be an SQL INSERT,
UPDATE or DELETE statement; or a SQL
statement that returns nothing, such as a DDL statement.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
INSERT, UPDATE,
or DELETE statements; or
0 for SQL statements that return nothing
DatabaseException - if a database access error occurs or
the SQL statement returns a ResultSet object
public void addBatch()
throws DatabaseException
DbPreparedStatement
object's batch of commands.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
DatabaseException - if a database access error occursDbStatement.addBatch(java.lang.String)
public void close()
throws DatabaseException
DbPreparedStatement object's database
and JDBC resources immediately instead of waiting for this to
happen when it is automatically closed. It is generally good
practice to release resources as soon as you are finished with them
to avoid tying up database resources.
Calling the method close on a
DbPreparedStatement object that is already closed has
no effect.
Note: A DbPreparedStatement object is
automatically closed when it is garbage collected. When a
DbPreparedStatement object is closed, its current
ResultSet object, if one exists, is also closed.
close in class DbStatementDatabaseException - if a database access error occurs
public ResultSetMetaData getMetaData()
throws DatabaseException
ResultSetMetaData object that contains
information about the columns of the ResultSet object
that will be returned when this PDbreparedStatement
object is executed.
Because a DbPreparedStatement object is
precompiled, it is possible to know about the
ResultSet object that it will return without having to
execute it. Consequently, it is possible to invoke the method
getMetaData on a DbPreparedStatement
object rather than waiting to execute it and then invoking the
ResultSet.getMetaData method on the
ResultSet object that is returned.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
NOTE: Using this method may be expensive for some drivers due to the lack of underlying DBMS support.
ResultSet object's
columns; or
null if the driver cannot return a
ResultSetMetaData object
DatabaseException - if a database access error occurs
public ParameterMetaData getParameterMetaData()
throws DatabaseException
DbPreparedStatement object's parameters.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
ParameterMetaData object that contains
information about the number, types and properties of this
DbPreparedStatement object's parameters.
DatabaseException - if a database access error occursParameterMetaData
public Object getVirtualParameterValue(String name)
throws UndefinedVirtualParameterException
name - the name of the parameter whose value should be
retrieved
DatabaseException - when an error occurred during the
retrieval of the parameter's value
UndefinedVirtualParameterException
public Object getVirtualParameterValue(int parameterIndex)
throws DatabaseException
parameterIndex - the index of the parameter whose value should
be retrieved
DatabaseException - when an error occurred during the
retrieval of the parameter's value
public DbPreparedStatement setBean(Object bean)
throws DatabaseException
ParametrizedQuery object of this
DbPrepareStatement instance.
bean - the bean whose properties should be assigned to the
query's parameters.
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if an error occurred during the manipulation of the bean's
properties.public void setVirtualParameters(VirtualParameters parameters)
DbPreparedStatement instance for
retrieval by other functionalities like capabilities.
parameters - the VirtualParameters instance that
will determine the virtual parameters
public int[] getParameterIndices(String parameterName)
throws DatabaseException
ParametrizedQuery object that is
used by this DbPreparedStatement instance.
parameterName - the name of the parameter that should be
looked up
int array with all the corresponding
indices
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found.
public DbPreparedStatement setDouble(String parameterName,
double x)
throws DatabaseException
double
value. The driver converts this to a SQL DOUBLE value
when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setDoubles(int[], double),
setDouble(int, double)
public DbPreparedStatement setDoubles(int[] parameterIndices,
double x)
throws DatabaseException
double value. The driver converts this to a SQL
DOUBLE value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetDouble(String, double),
setDouble(int, double)
public DbPreparedStatement setDouble(int parameterIndex,
double x)
throws DatabaseException
double
value. The driver converts this to a SQL DOUBLE value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetDouble(String, double),
setDoubles(int[], double)
public DbPreparedStatement setShort(String parameterName,
short x)
throws DatabaseException
short
value. The driver converts this to a SQL SMALLINT
value when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setShorts(int[], short),
setShort(int, short)
public DbPreparedStatement setShorts(int[] parameterIndices,
short x)
throws DatabaseException
short
value. The driver converts this to a SQL SMALLINT
value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetShort(String, short),
setShort(int, short)
public DbPreparedStatement setShort(int parameterIndex,
short x)
throws DatabaseException
short
value. The driver converts this to a SQL SMALLINT
value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetShort(String, short),
setShorts(int[], short)
public DbPreparedStatement setNull(String parameterName,
int sqlType)
throws DatabaseException
NULL.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
Note: You must specify the parameter's SQL type.
parameterName - the name of the parameters that have to be setsqlType - the SQL type code defined in
java.sql.Types
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.Types,
setNulls(int[], int),
setNull(int, int)
public DbPreparedStatement setNulls(int[] parameterIndices,
int sqlType)
throws DatabaseException
NULL.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
Note: You must specify the parameter's SQL type.
parameterIndices - the first parameter is 1, the second is 2,
...sqlType - the SQL type code defined in
java.sql.Types
DbPreparedStatement instance.
DatabaseException - if a database access error occursTypes,
setNull(String, int),
setNull(int, int)
public DbPreparedStatement setNull(int parameterIndex,
int sqlType)
throws DatabaseException
NULL.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
Note: You must specify the parameter's SQL type.
parameterIndex - the first parameter is 1, the second is 2,
...sqlType - the SQL type code defined in
java.sql.Types
DbPreparedStatement instance.
DatabaseException - if a database access error occursTypes,
setNull(String, int),
setNulls(int[], int)
public DbPreparedStatement setNull(String parameterName,
int sqlType,
String typeName)
throws DatabaseException
NULL. This version of
the method setNull should be used for user-defined
types and REF type parameters. Examples of user-defined types
include: STRUCT, DISTINCT, 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 driver does not need the type code or type name information, it may ignore it.
Although it is intended for user-defined and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the given typeName is ignored.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setsqlType - a value from java.sql.TypestypeName - the fully-qualified name of an SQL user-defined
type; ignored if the parameter is not a user-defined type or REF
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.Types,
setNulls(int[], int, String),
setNull(int, int, String)
public DbPreparedStatement setNulls(int[] parameterIndices,
int sqlType,
String typeName)
throws DatabaseException
NULL. This
version of the method setNull should be used for
user-defined types and REF type parameters. Examples of
user-defined types include: STRUCT, DISTINCT, 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 driver does not need the type code or type name information, it may ignore it.
Although it is intended for user-defined and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the given typeName is ignored.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...sqlType - a value from java.sql.TypestypeName - the fully-qualified name of an SQL user-defined
type; ignored if the parameter is not a user-defined type or REF
DbPreparedStatement instance.
DatabaseException - if a database access error occursTypes,
setNull(String, int, String),
setNull(int, int, String)
public DbPreparedStatement setNull(int parameterIndex,
int sqlType,
String typeName)
throws DatabaseException
NULL. This
version of the method setNull should be used for
user-defined types and REF type parameters. Examples of
user-defined types include: STRUCT, DISTINCT, 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 driver does not need the type code or type name information, it may ignore it.
Although it is intended for user-defined and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the given typeName is ignored.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...sqlType - a value from java.sql.TypestypeName - the fully-qualified name of an SQL user-defined
type; ignored if the parameter is not a user-defined type or REF
DbPreparedStatement instance.
DatabaseException - if a database access error occursTypes,
setNull(String, int, String),
setNulls(int[], int, String)
public DbPreparedStatement setBoolean(String parameterName,
boolean x)
throws DatabaseException
boolean
value. The driver converts this to a SQL BIT value
when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setBoolean(String, boolean),
setBooleans(int[], boolean)
public DbPreparedStatement setBooleans(int[] parameterIndices,
boolean x)
throws DatabaseException
boolean value. The driver converts this to a SQL
BIT value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetBoolean(String, boolean),
setBoolean(int, boolean)
public DbPreparedStatement setBoolean(int parameterIndex,
boolean x)
throws DatabaseException
boolean value. The driver converts this to a SQL
BIT value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetBoolean(String, boolean),
setBooleans(int[], boolean)
public DbPreparedStatement setByte(String parameterName,
byte x)
throws DatabaseException
byte
value. The driver converts this to a SQL TINYINT value
when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setByte(int, byte),
setBytes(int[], byte)
public DbPreparedStatement setBytes(int[] parameterIndices,
byte x)
throws DatabaseException
byte
value. The driver converts this to a SQL TINYINT value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetByte(String, byte),
setByte(int, byte)
public DbPreparedStatement setByte(int parameterIndex,
byte x)
throws DatabaseException
byte
value. The driver converts this to a SQL TINYINT value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetByte(String, byte),
setBytes(int[], byte)
public DbPreparedStatement setDate(String parameterName,
Date x)
throws DatabaseException
java.sql.Date
value. The driver converts this to a SQL DATE value
when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setDates(int[], Date),
setDate(int, Date)
public DbPreparedStatement setDates(int[] parameterIndices,
Date x)
throws DatabaseException
java.sql.Date value. The driver converts this to a SQL
DATE value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetDate(String, Date),
setDate(int, Date)
public DbPreparedStatement setDate(int parameterIndex,
Date x)
throws DatabaseException
java.sql.Date value. The driver converts this to a SQL
DATE value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetDate(String, Date),
setDates(int[], Date)
public DbPreparedStatement setDate(String parameterName,
Date x,
Calendar cal)
throws DatabaseException
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 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.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter valuecal - the Calendar object the driver will use to
construct the date
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setDates(int[], Date, Calendar),
setDate(int, Date, Calendar)
public DbPreparedStatement setDates(int[] parameterIndices,
Date x,
Calendar cal)
throws DatabaseException
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
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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter valuecal - the Calendar object the driver will use to
construct the date
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetDate(String, Date, Calendar),
setDate(int, Date, Calendar)
public DbPreparedStatement setDate(int parameterIndex,
Date x,
Calendar cal)
throws DatabaseException
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
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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter valuecal - the Calendar object the driver will use to
construct the date
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetDate(String, Date, Calendar),
setDates(int[], Date, Calendar)
public DbPreparedStatement setInt(String parameterName,
int x)
throws DatabaseException
int value.
The driver converts this to a SQL INTEGER value when
it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setInt(int, int),
setInts(int[], int)
public DbPreparedStatement setInts(int[] parameterIndices,
int x)
throws DatabaseException
int
value. The driver converts this to a SQL INTEGER value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetInt(String, int),
setInt(int, int)
public DbPreparedStatement setInt(int parameterIndex,
int x)
throws DatabaseException
int
value. The driver converts this to a SQL INTEGER value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetInt(String, int),
setInts(int[], int)
public DbPreparedStatement setLong(String parameterName,
long x)
throws DatabaseException
long
value. The driver converts this to a SQL BIGINT value
when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setLongs(int[], long),
setLong(int, long)
public DbPreparedStatement setLongs(int[] parameterIndices,
long x)
throws DatabaseException
long
value. The driver converts this to a SQL BIGINT value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetLong(String, long),
setLong(int, long)
public DbPreparedStatement setLong(int parameterIndex,
long x)
throws DatabaseException
long
value. The driver converts this to a SQL BIGINT value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetLong(String, long),
setLongs(int[], long)
public DbPreparedStatement setFloat(String parameterName,
float x)
throws DatabaseException
float
value. The driver converts this to a SQL FLOAT value
when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setFloats(int[], float),
setFloat(int, float)
public DbPreparedStatement setFloats(int[] parameterIndices,
float x)
throws DatabaseException
float
value. The driver converts this to a SQL FLOAT value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetFloat(String, float),
setFloat(int, float)
public DbPreparedStatement setFloat(int parameterIndex,
float x)
throws DatabaseException
float
value. The driver converts this to a SQL FLOAT value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetFloat(String, float),
setFloats(int[], float)
public DbPreparedStatement setBigDecimal(String parameterName,
BigDecimal x)
throws DatabaseException
java.math.BigDecimal value. The driver converts this
to a SQL NUMERIC value when it sends it to the
database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setBigDecimal(int, BigDecimal),
setBigDecimals(int[], BigDecimal)
public DbPreparedStatement setBigDecimals(int[] parameterIndices,
BigDecimal x)
throws DatabaseException
java.math.BigDecimal value. The driver converts this
to a SQL NUMERIC value when it sends it to the
database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetBigDecimal(String, BigDecimal),
setBigDecimal(int, BigDecimal)
public DbPreparedStatement setBigDecimal(int parameterIndex,
BigDecimal x)
throws DatabaseException
java.math.BigDecimal value. The driver converts this
to a SQL NUMERIC value when it sends it to the
database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetBigDecimal(String, BigDecimal),
setBigDecimals(int[], BigDecimal)
public DbPreparedStatement setString(String parameterName,
String x)
throws DatabaseException
String
value. The driver converts this to a 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.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setString(int, String),
setStrings(int[], String)
public DbPreparedStatement setStrings(int[] parameterIndices,
String x)
throws DatabaseException
String value. The driver converts this to a 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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetString(String, String),
setString(int, String)
public DbPreparedStatement setString(int parameterIndex,
String x)
throws DatabaseException
String
value. The driver converts this to a 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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetString(String, String),
setStrings(int[], String)
public DbPreparedStatement setBytes(String parameterName,
byte[] x)
throws DatabaseException
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.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setBytes(int[], byte[]),
setBytes(int, byte[])
public DbPreparedStatement setBytes(int[] parameterIndices,
byte[] x)
throws DatabaseException
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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetBytes(String, byte[]),
setBytes(int, byte[])
public DbPreparedStatement setBytes(int parameterIndex,
byte[] x)
throws DatabaseException
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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetBytes(String, byte[]),
setBytes(int[], byte[])
public DbPreparedStatement setObject(String parameterName,
Object x,
int targetSqlType,
int scale)
throws DatabaseException
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,
Struct, or Array, the driver should pass
it to the database as a value of the corresponding SQL type.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
Note that this method may be used to pass database-specific abstract data types.
parameterName - the name of the parameters that have to be setx - the object containing the input parameter valuetargetSqlType - 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.
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.Types,
setObjects(int[], Object, int, int),
setObject(int, Object, int, int)
public DbPreparedStatement setObjects(int[] parameterIndices,
Object x,
int targetSqlType,
int scale)
throws DatabaseException
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,
Struct, or Array, the driver should pass
it to the database as a value of the corresponding SQL type.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
Note that this method may be used to pass database-specific abstract data types.
parameterIndices - the first parameter is 1, the second is 2,
...x - the object containing the input parameter valuetargetSqlType - 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.
DbPreparedStatement instance.
DatabaseException - if a database access error occursTypes,
setObject(String, Object, int, int),
setObject(int, Object, int, int)
public DbPreparedStatement setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
throws DatabaseException
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,
Struct, or Array, the driver should pass
it to the database as a value of the corresponding SQL type.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
Note that this method may be used to pass database-specific abstract data types.
parameterIndex - the first parameter is 1, the second is 2,
...x - the object containing the input parameter valuetargetSqlType - 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.
DbPreparedStatement instance.
DatabaseException - if a database access error occursTypes,
setObject(String, Object, int, int),
setObjects(int[], Object, int, int)
public DbPreparedStatement setObject(String parameterName,
Object x,
int targetSqlType)
throws DatabaseException
setObject above, except that
it assumes a scale of zero.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the object containing the input parameter valuetargetSqlType - the SQL type (as defined in java.sql.Types) to
be sent to the database
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.Types,
setObjects(int[], Object, int),
setObject(int, Object, int)
public DbPreparedStatement setObjects(int[] parameterIndices,
Object x,
int targetSqlType)
throws DatabaseException
setObject above, except
that it assumes a scale of zero.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the object containing the input parameter valuetargetSqlType - the SQL type (as defined in java.sql.Types) to
be sent to the database
DbPreparedStatement instance.
DatabaseException - if a database access error occursTypes,
setObject(String, Object, int),
setObject(int, Object, int)
public DbPreparedStatement setObject(int parameterIndex,
Object x,
int targetSqlType)
throws DatabaseException
setObject above, except
that it assumes a scale of zero.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the object containing the input parameter valuetargetSqlType - the SQL type (as defined in java.sql.Types) to
be sent to the database
DbPreparedStatement instance.
DatabaseException - if a database access error occursTypes,
setObject(String, Object, int),
setObjects(int[], Object, int)
public DbPreparedStatement setTime(String parameterName,
Time x)
throws DatabaseException
java.sql.Time
value. The driver converts this to a SQL TIME value
when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setTimes(int[], Time),
setTime(int, Time)
public DbPreparedStatement setTimes(int[] parameterIndices,
Time x)
throws DatabaseException
java.sql.Time value. The driver converts this to a SQL
TIME value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetTime(String, Time),
setTime(int, Time)
public DbPreparedStatement setTime(int parameterIndex,
Time x)
throws DatabaseException
java.sql.Time value. The driver converts this to a SQL
TIME value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetTime(String, Time),
setTimes(int[], Time)
public DbPreparedStatement setTime(String parameterName,
Time x,
Calendar cal)
throws DatabaseException
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 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.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter valuecal - the Calendar object the driver will use to
construct the time
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setTimes(int[], Time, Calendar),
setTime(int, Time, Calendar)
public DbPreparedStatement setTimes(int[] parameterIndices,
Time x,
Calendar cal)
throws DatabaseException
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
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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter valuecal - the Calendar object the driver will use to
construct the time
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetTime(String, Time, Calendar),
setTime(int, Time, Calendar)
public DbPreparedStatement setTime(int parameterIndex,
Time x,
Calendar cal)
throws DatabaseException
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
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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter valuecal - the Calendar object the driver will use to
construct the time
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetTime(String, Time, Calendar),
setTimes(int[], Time, Calendar)
public DbPreparedStatement setTimestamp(String parameterName,
Timestamp x)
throws DatabaseException
java.sql.Timestamp value. The driver converts this to
a SQL TIMESTAMP value when it sends it to the
database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setTimestamps(int[], Timestamp),
setTimestamp(int, Timestamp)
public DbPreparedStatement setTimestamps(int[] parameterIndices,
Timestamp x)
throws DatabaseException
java.sql.Timestamp value. The driver converts this to
a SQL TIMESTAMP value when it sends it to the
database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetTimestamp(String, Timestamp),
setTimestamp(int, Timestamp)
public DbPreparedStatement setTimestamp(int parameterIndex,
Timestamp x)
throws DatabaseException
java.sql.Timestamp value. The driver converts this to
a SQL TIMESTAMP value when it sends it to the
database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetTimestamp(String, Timestamp),
setTimestamps(int[], Timestamp)
public DbPreparedStatement setTimestamp(String parameterName,
Timestamp x,
Calendar cal)
throws DatabaseException
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 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.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the parameter valuecal - the Calendar object the driver will use to
construct the timestamp
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setTimestamps(int[], Timestamp, Calendar),
setTimestamp(int, Timestamp, Calendar)
public DbPreparedStatement setTimestamps(int[] parameterIndices,
Timestamp x,
Calendar cal)
throws DatabaseException
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 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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the parameter valuecal - the Calendar object the driver will use to
construct the timestamp
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetTimestamp(String, Timestamp, Calendar),
setTimestamp(int, Timestamp, Calendar)
public DbPreparedStatement setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal)
throws DatabaseException
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 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.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the parameter valuecal - the Calendar object the driver will use to
construct the timestamp
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetTimestamp(String, Timestamp, Calendar),
setTimestamps(int[], Timestamp, Calendar)
public DbPreparedStatement setAsciiStream(String parameterName,
InputStream x,
int length)
throws DatabaseException
LONGVARCHAR parameter, it may be more
practical to send it via a java.io.InputStream. Data
will be read from the stream as needed until end-of-file is
reached. The JDBC driver will do any necessary conversion from
ASCII to the database char format.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterName - the name of the parameter that will be set
(the first parameter with the name will be used)x - the Java input stream that contains the ASCII parameter
valuelength - the number of bytes in the stream
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setAsciiStream(int, InputStream, int)
public DbPreparedStatement setAsciiStream(int parameterIndex,
InputStream x,
int length)
throws DatabaseException
LONGVARCHAR parameter, it may be more
practical to send it via a java.io.InputStream. Data
will be read from the stream as needed until end-of-file is
reached. The JDBC driver will do any necessary conversion from
ASCII to the database char format.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterIndex - the first parameter is 1, the second is 2,
...x - the Java input stream that contains the ASCII parameter
valuelength - the number of bytes in the stream
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetAsciiStream(String, InputStream, int)
public DbPreparedStatement setCharacterStream(String parameterName,
Reader x,
int length)
throws DatabaseException
Reader object,
which is the given number of characters long. When a very large
UNICODE value is input to a LONGVARCHAR parameter, it
may be more practical to send it via a java.io.Reader
object. The data will be read from the stream as needed until
end-of-file is reached. The JDBC driver will do any necessary
conversion from UNICODE to the database char format.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterName - the name of the parameter that will be set
(the first parameter with the name will be used)x - the java.io.Reader object that contains
the Unicode datalength - the number of characters in the stream
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setCharacterStream(int, Reader, int)
public DbPreparedStatement setCharacterStream(int parameterIndex,
Reader x,
int length)
throws DatabaseException
Reader
object, which is the given number of characters long. When a very
large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader object. The data will be read from the
stream as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char
format.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterIndex - the first parameter is 1, the second is 2,
...x - the java.io.Reader object that contains
the Unicode datalength - the number of characters in the stream
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetCharacterStream(String, Reader, int)
public DbPreparedStatement setBinaryStream(String parameterName,
InputStream x,
int length)
throws DatabaseException
LONGVARBINARY parameter, it may be more
practical to send it via a java.io.InputStream object.
The data will be read from the stream as needed until end-of-file
is reached.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterName - the name of the parameter that will be set
(the first parameter with the name will be used)x - the java input stream which contains the binary parameter
valuelength - the number of bytes in the stream
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setBinaryStream(int, InputStream, int)
public DbPreparedStatement setBinaryStream(int parameterIndex,
InputStream x,
int length)
throws DatabaseException
LONGVARBINARY parameter, it may be more
practical to send it via a java.io.InputStream object.
The data will be read from the stream as needed until end-of-file
is reached.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
parameterIndex - the first parameter is 1, the second is 2,
...x - the java input stream which contains the binary parameter
valuelength - the number of bytes in the stream
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetBinaryStream(String, InputStream, int)
public DbPreparedStatement setArray(String parameterName,
Array x)
throws DatabaseException
Array object.
The driver converts this to a SQL ARRAY value when it
sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameter that will be setx - an Array object that maps an SQL
ARRAY value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setArray(int, Array)
public DbPreparedStatement setArray(int parameterIndex,
Array x)
throws DatabaseException
Array
object. The driver converts this to a SQL ARRAY value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - an Array object that maps an SQL
ARRAY value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetArray(String, Array)
public DbPreparedStatement setObject(String parameterName,
Object x)
throws DatabaseException
Object; therefore,
the java.lang equivalent objects should be used for
built-in types.
The JDBC specification specifies a standard mapping from Java
Object types to SQL types. The given argument will be
converted to the corresponding SQL type before being sent to the
database.
Note that this method may be used to pass datatabase-specific abstract data types, by using a driver-specific Java type.
If the object is of a class implementing the interface
SQLData, the JDBC driver should call the method
SQLData.writeSQL to write it to the SQL data stream.
If, on the other hand, the object is of a class implementing
Ref, Blob, Clob,
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 of the interfaces named above.
If such an ambiquity exception is thrown or if a database access
error occurs, this DbPreparedStatement instance is
automatically closed.
parameterName - the name of the parameter that will be setx - the object containing the input parameter value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs, or if the type of the given object is
ambiguous.setObjects(int[], Object),
setObject(int, Object)
public DbPreparedStatement setObjects(int[] parameterIndices,
Object x)
throws DatabaseException
Object;
therefore, the java.lang equivalent objects should be
used for built-in types.
The JDBC specification specifies a standard mapping from Java
Object types to SQL types. The given argument will be
converted to the corresponding SQL type before being sent to the
database.
Note that this method may be used to pass datatabase-specific abstract data types, by using a driver-specific Java type.
If the object is of a class implementing the interface
SQLData, the JDBC driver should call the method
SQLData.writeSQL to write it to the SQL data stream.
If, on the other hand, the object is of a class implementing
Ref, Blob, Clob,
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 of the interfaces named above.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the object containing the input parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurs or
the type of the given object is ambiguoussetObject(String, Object),
setObject(int, Object)
public DbPreparedStatement setObject(int parameterIndex,
Object x)
throws DatabaseException
Object;
therefore, the java.lang equivalent objects should be
used for built-in types.
The JDBC specification specifies a standard mapping from Java
Object types to SQL types. The given argument will be
converted to the corresponding SQL type before being sent to the
database.
Note that this method may be used to pass datatabase-specific abstract data types, by using a driver-specific Java type.
If the object is of a class implementing the interface
SQLData, the JDBC driver should call the method
SQLData.writeSQL to write it to the SQL data stream.
If, on the other hand, the object is of a class implementing
Ref, Blob, Clob,
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 of the interfaces named above.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - the object containing the input parameter value
DbPreparedStatement instance.
DatabaseException - if a database access error occurs or
the type of the given object is ambiguoussetObject(String, Object),
setObjects(int[], Object)
public DbPreparedStatement setRef(String parameterName,
Ref x)
throws DatabaseException
REF(<structured-type>) value. The driver
converts this to a SQL REF value when it sends it to
the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameter that will be set
(the first parameter with the name will be used)x - an SQL REF value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setRef(int, Ref)
public DbPreparedStatement setRef(int parameterIndex,
Ref x)
throws DatabaseException
REF(<structured-type>) value. The driver
converts this to a SQL REF value when it sends it to
the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - an SQL REF value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetRef(String, Ref)
public DbPreparedStatement setBlob(String parameterName,
Blob x)
throws DatabaseException
Blob object. The
driver converts this to a SQL BLOB value when it sends
it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameter that will be set
(the first parameter with the name will be used)x - a Blob object that maps an SQL
BLOB value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setBlob(String, Blob)
public DbPreparedStatement setBlob(int parameterIndex,
Blob x)
throws DatabaseException
Blob
object. The driver converts this to a SQL BLOB value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - a Blob object that maps an SQL
BLOB value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetBlob(String, Blob)
public DbPreparedStatement setClob(String parameterName,
Clob x)
throws DatabaseException
Clob object. The
driver converts this to a SQL CLOB value when it sends
it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterName - the name of the parameter that will be set
(the first parameter with the name will be used)x - a Clob object that maps an SQL
CLOB value
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setClob(int, Clob)
public DbPreparedStatement setClob(int parameterIndex,
Clob x)
throws DatabaseException
Clob
object. The driver converts this to a SQL CLOB value
when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2,
...x - a Clob object that maps an SQL
CLOB value
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetClob(String, Clob)
public DbPreparedStatement setURL(String parameterName,
URL x)
throws DatabaseException
java.net.URL
value. The driver converts this to a SQL DATALINK
value when it sends it to the database.
If a database access error occurs, this
DbPreparedStatement instance is automatically closed.
parameterName - the name of the parameters that have to be setx - the java.net.URL object to be set
DbPreparedStatement instance.
DatabaseException - when this
DbPrepareStatement instance wasn't defined by a
ParametrizedQuery but by a regular sql string, or if
the ParametrizedQuery doesn't contain any parameters,
or if no parameters with this name could be found, or if a database
access error occurs.setURLs(int[], URL),
setURL(int, URL)
public DbPreparedStatement setURLs(int[] parameterIndices,
URL x)
throws DatabaseException
java.net.URL value. The driver converts this to a SQL
DATALINK value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndices - the first parameter is 1, the second is 2,
...x - the java.net.URL object to be set
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetURL(String, URL),
setURL(int, URL)
public DbPreparedStatement setURL(int parameterIndex,
URL x)
throws DatabaseException
java.net.URL value. The driver converts this to a SQL
DATALINK value when it sends it to the database.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
parameterIndex - the first parameter is 1, the second is 2, ...x - the java.net.URL object to be set
DbPreparedStatement instance.
DatabaseException - if a database access error occurssetURL(String, URL),
setURLs(int[], URL)
public void clearParameters()
throws DatabaseException
In general, parameter values remain in force for repeated use of
a statement. Setting a parameter value automatically clears its
previous value. However, in some cases it is useful to immediately
release the resources used by the current parameter values; this
can be done by calling the method clearParameters.
If an exception is thrown, this DbPreparedStatement
is automatically closed and an ongoing transaction will be
automatically rolled back if it belongs to the executing thread.
DatabaseException - if a database access error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||