|
Final | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface CallableStatement
An interface used to call Stored Procedures.
The JDBC API provides an SQL escape syntax allowing Stored Procedures to be
called in a standard way for all databases. The JDBC escape syntax has two
forms. One form includes a result parameter. The second form does not include
a result parameter. Where the result parameter is used, it must be declared
as an OUT parameter. Other parameters can be declared as IN, OUT or INOUT.
Parameters are referenced either by name or by a numerical index, with the
first parameter being 1, the second 1 and so on. Here are examples of the two
forms of the escape syntax:
{ ?= call <.procedurename>.[([parameter1,parameter2,...])]}
{call <.procedurename>.[([parameter1,parameter2,...])]}
IN parameters are set before calling the procedure, using the setter methods
which are inherited from PreparedStatement. For OUT
parameters, their Type must be registered before executing the stored
procedure, and the value is retrieved using the getter methods defined in the
CallableStatement interface.
CallableStatements can return one or more ResultSets. Where multiple
ResultSets are returned they are accessed using the methods inherited from
the Statement interface.
| Field Summary |
|---|
| Fields inherited from interface java.sql.Statement |
|---|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
| Method Summary | |
|---|---|
Array |
getArray(int parameterIndex)
Gets the value of a specified JDBC ARRAY parameter as a
java.sql.Array. |
Array |
getArray(String parameterName)
Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array. |
BigDecimal |
getBigDecimal(int parameterIndex)
Returns a new BigDecimal representation of the JDBC
NUMERIC parameter specified by the input index. |
BigDecimal |
getBigDecimal(int parameterIndex,
int scale)
Deprecated. Use getBigDecimal(int parameterIndex) or getBigDecimal(String parameterName) |
BigDecimal |
getBigDecimal(String parameterName)
Returns a new BigDecimal representation of the JDBC
NUMERIC parameter specified by the input name. |
Blob |
getBlob(int parameterIndex)
Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob |
Blob |
getBlob(String parameterName)
Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob |
boolean |
getBoolean(int parameterIndex)
Gets the value of a specified JDBC BIT parameter as a boolean |
boolean |
getBoolean(String parameterName)
Gets the value of a specified JDBC BIT parameter as a
boolean |
byte |
getByte(int parameterIndex)
Gets the value of a specified JDBC TINYINT parameter as a byte |
byte |
getByte(String parameterName)
Gets the value of a specified JDBC TINYINT parameter as a
Java byte. |
byte[] |
getBytes(int parameterIndex)
Returns a byte array representation of the indexed JDBC BINARY or VARBINARY parameter. |
byte[] |
getBytes(String parameterName)
Returns a byte array representation of the named JDBC BINARY
or VARBINARY parameter. |
Clob |
getClob(int parameterIndex)
Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob |
Clob |
getClob(String parameterName)
Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob |
Date |
getDate(int parameterIndex)
Gets the value of a specified JDBC DATE parameter as a java.sql.Date. |
Date |
getDate(int parameterIndex,
Calendar cal)
Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date. |
Date |
getDate(String parameterName)
Gets the value of a specified JDBC DATE parameter as a java.sql.Date. |
Date |
getDate(String parameterName,
Calendar cal)
Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date. |
double |
getDouble(int parameterIndex)
Gets the value of a specified JDBC DOUBLE parameter as a double |
double |
getDouble(String parameterName)
Gets the value of a specified JDBC DOUBLE parameter as a double |
float |
getFloat(int parameterIndex)
Gets the value of a specified JDBC FLOAT parameter as a float |
float |
getFloat(String parameterName)
Gets the value of a specified JDBC FLOAT parameter as a
Java float. |
int |
getInt(int parameterIndex)
Gets the value of a specified JDBC INTEGER parameter as an int |
int |
getInt(String parameterName)
Gets the value of a specified JDBC INTEGER parameter as an int |
long |
getLong(int parameterIndex)
Gets the value of a specified JDBC BIGINT parameter as a long |
long |
getLong(String parameterName)
Gets the value of a specified JDBC BIGINT parameter as a long |
Object |
getObject(int parameterIndex)
Gets the value of a specified parameter as a Java Object. |
Object |
getObject(int parameterIndex,
Map<String,Class<?>> map)
Gets the value of a specified parameter as an Object. |
Object |
getObject(String parameterName)
Gets the value of a specified parameter as an Object. |
Object |
getObject(String parameterName,
Map<String,Class<?>> map)
Gets the value of a specified parameter as an Object. |
Ref |
getRef(int parameterIndex)
Gets the value of a specified JDBC REF( |
Ref |
getRef(String parameterName)
Gets the value of a specified JDBC REF( |
short |
getShort(int parameterIndex)
Gets the value of a specified JDBC SMALLINT parameter as a short |
short |
getShort(String parameterName)
Gets the value of a specified JDBC SMALLINT parameter as a
short |
String |
getString(int parameterIndex)
Returns the indexed parameter's value as a string. |
String |
getString(String parameterName)
Returns the named parameter's value as a string. |
Time |
getTime(int parameterIndex)
Gets the value of a specified JDBC TIME parameter as a java.sql.Time. |
Time |
getTime(int parameterIndex,
Calendar cal)
Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time. |
Time |
getTime(String parameterName)
Gets the value of a specified JDBC TIME parameter as a
|
Time |
getTime(String parameterName,
Calendar cal)
Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time. |
Timestamp |
getTimestamp(int parameterIndex)
Returns the indexed parameter's TIMESTAMP value as a
java.sql.Timestamp. |
Timestamp |
getTimestamp(int parameterIndex,
Calendar cal)
Returns the indexed parameter's TIMESTAMP value as a
java.sql.Timestamp. |
Timestamp |
getTimestamp(String parameterName)
Returns the named parameter's TIMESTAMP value as a
java.sql.Timestamp. |
Timestamp |
getTimestamp(String parameterName,
Calendar cal)
Returns the indexed parameter's TIMESTAMP value as a
java.sql.Timestamp. |
URL |
getURL(int parameterIndex)
Gets the value of a specified JDBC DATALINK parameter as a java.net.URL. |
URL |
getURL(String parameterName)
Returns the named parameter's JDBC DATALINK value in a new
Java java.net.URL. |
void |
registerOutParameter(int parameterIndex,
int sqlType)
Defines the Type of a specified OUT parameter. |
void |
registerOutParameter(int parameterIndex,
int sqlType,
int scale)
Defines the Type of a specified OUT parameter. |
void |
registerOutParameter(int paramIndex,
int sqlType,
String typeName)
Defines the Type of a specified OUT parameter. |
void |
registerOutParameter(String parameterName,
int sqlType)
Defines the Type of a specified OUT parameter. |
void |
registerOutParameter(String parameterName,
int sqlType,
int scale)
Defines the Type of a specified OUT parameter. |
void |
registerOutParameter(String parameterName,
int sqlType,
String typeName)
Defines the Type of a specified OUT parameter. |
void |
setAsciiStream(String parameterName,
InputStream theInputStream,
int length)
Sets the value of a specified parameter to the content of a supplied InputStream, which has a specified number of bytes. |
void |
setBigDecimal(String parameterName,
BigDecimal theBigDecimal)
Sets the value of a specified parameter to a supplied java.math.BigDecimal value. |
void |
setBinaryStream(String parameterName,
InputStream theInputStream,
int length)
Sets the value of a specified parameter to the content of a supplied binary InputStream, which has a specified number of bytes. |
void |
setBoolean(String parameterName,
boolean theBoolean)
Sets the value of a specified parameter to a supplied boolean value. |
void |
setByte(String parameterName,
byte theByte)
Sets the value of a specified parameter to a supplied byte value. |
void |
setBytes(String parameterName,
byte[] theBytes)
Sets the value of a specified parameter to a supplied array of bytes. |
void |
setCharacterStream(String parameterName,
Reader reader,
int length)
Sets the value of a specified parameter to the character content of a Reader object, with the specified length of character data. |
void |
setDate(String parameterName,
Date theDate)
Sets the value of a specified parameter to a supplied java.sql.Date value. |
void |
setDate(String parameterName,
Date theDate,
Calendar cal)
Sets the value of a specified parameter to a supplied java.sql.Date value, using a supplied Calendar to map the Date. |
void |
setDouble(String parameterName,
double theDouble)
Sets the value of a specified parameter to a supplied double value. |
void |
setFloat(String parameterName,
float theFloat)
Sets the value of a specified parameter to to a supplied float value. |
void |
setInt(String parameterName,
int theInt)
Sets the value of a specified parameter to a supplied int value. |
void |
setLong(String parameterName,
long theLong)
Sets the value of a specified parameter to a supplied long value. |
void |
setNull(String parameterName,
int sqlType)
Sets the value of a specified parameter to SQL NULL. |
void |
setNull(String parameterName,
int sqlType,
String typeName)
Sets the value of a specified parameter to be SQL NULL where the parameter type is either REF or user defined (e.g. |
void |
setObject(String parameterName,
Object theObject)
Sets the value of a specified parameter using a supplied object. |
void |
setObject(String parameterName,
Object theObject,
int targetSqlType)
Sets the value of a specified parameter using a supplied object. |
void |
setObject(String parameterName,
Object theObject,
int targetSqlType,
int scale)
Sets the value of a specified parameter using a supplied object. |
void |
setShort(String parameterName,
short theShort)
Sets the value of a specified parameter to a supplied short value. |
void |
setString(String parameterName,
String theString)
Sets the value of a specified parameter to a supplied String. |
void |
setTime(String parameterName,
Time theTime)
Sets the value of the parameter named parameterName to the
value of the supplied java.sql.Time. |
void |
setTime(String parameterName,
Time theTime,
Calendar cal)
Sets the value of the parameter named parameterName to the
value of the supplied java.sql.Time using the supplied
Calendar. |
void |
setTimestamp(String parameterName,
Timestamp theTimestamp)
Sets the value of a specified parameter to a supplied java.sql.Timestamp value. |
void |
setTimestamp(String parameterName,
Timestamp theTimestamp,
Calendar cal)
Sets the value of a specified parameter to a supplied java.sql.Timestamp value, using the supplied Calendar. |
void |
setURL(String parameterName,
URL theURL)
Sets the value of a specified parameter to the supplied java.net.URL. |
boolean |
wasNull()
Gets whether the value of the last OUT parameter read was SQL NULL. |
| Methods inherited from interface java.sql.PreparedStatement |
|---|
addBatch, clearParameters, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL |
| Method Detail |
|---|
Array getArray(int parameterIndex)
throws SQLException
ARRAY parameter as a
java.sql.Array.
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensArray getArray(String parameterName)
throws SQLException
parameterName - the parameter of interest's name
java.sql.Array containing the parameter value
SQLException - if there is a problem accessing the databaseBigDecimal getBigDecimal(int parameterIndex)
throws SQLException
BigDecimal representation of the JDBC
NUMERIC parameter specified by the input index.
parameterIndex - the parameter number index (starts from 1)
java.math.BigDecimal with the value of the
specified parameter. The value null is returned if
the parameter in question is an SQL NULL
SQLException - if there is a problem accessing the database@Deprecated
BigDecimal getBigDecimal(int parameterIndex,
int scale)
throws SQLException
BigDecimal representation of the JDBC
NUMERIC parameter specified by the input index. The number
of digits after the decimal point is specified by scale.
parameterIndex - the parameter number index, where the first parameter has
index 1scale - the number of digits after the decimal point to get
java.math.BigDecimal with the value of the
specified parameter. The value null is returned if
the parameter in question is an SQL NULL
SQLException - if there is a problem accessing the databaseBigDecimal getBigDecimal(String parameterName)
throws SQLException
BigDecimal representation of the JDBC
NUMERIC parameter specified by the input name.
parameterName - the name of the parameter
SQLException - if a database error happensBlob getBlob(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensBlob getBlob(String parameterName)
throws SQLException
parameterName - the name of the parameter
SQLException - if a database error happensboolean getBoolean(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensboolean getBoolean(String parameterName)
throws SQLException
BIT parameter as a
boolean
parameterName - the parameter of interest's name
boolean representation of the value of the
parameter. false is returned if the SQL value is
NULL.
SQLException - if there is a problem accessing the databasebyte getByte(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensbyte getByte(String parameterName)
throws SQLException
TINYINT parameter as a
Java byte.
parameterName - the parameter of interest's name
byte representation of the value of the
parameter. 0 is returned if the SQL value is
NULL.
SQLException - if there is a problem accessing the databasebyte[] getBytes(int parameterIndex)
throws SQLException
BINARY or VARBINARY parameter.
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if there is a problem accessing the databasebyte[] getBytes(String parameterName)
throws SQLException
BINARY
or VARBINARY parameter.
parameterName - the name of the parameter
SQLException - if there is a problem accessing the databaseClob getClob(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensClob getClob(String parameterName)
throws SQLException
parameterName - the name of the parameter
SQLException - if a database error happensDate getDate(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensDate getDate(int parameterIndex,
Calendar cal)
throws SQLException
The JDBC driver uses the Calendar to create the Date using a particular timezone and locale. Default behaviour of the driver is to use the Java virtual machine default settings.
parameterIndex - the parameter number index, where the first parameter has
index 1cal - the Calendar to use to construct the Date
SQLException - if a database error happensDate getDate(String parameterName)
throws SQLException
parameterName - the name of the parameter
SQLException - if a database error happensDate getDate(String parameterName,
Calendar cal)
throws SQLException
The JDBC driver uses the Calendar to create the Date using a particular timezone and locale. Default behaviour of the driver is to use the Java virtual machine default settings.
parameterName - the parameter namecal - used for creating the returned Date
SQLException - if a database error happensdouble getDouble(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensdouble getDouble(String parameterName)
throws SQLException
parameterName - the parameter name
double.
An SQL value of NULL gets represented as
0 (zero).
SQLException - if there is a problem accessing the databasefloat getFloat(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensfloat getFloat(String parameterName)
throws SQLException
FLOAT parameter as a
Java float.
parameterName - the parameter name
float.
An SQL value of NULL gets represented as
0 (zero).
SQLException - if there is a problem accessing the databaseint getInt(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensint getInt(String parameterName)
throws SQLException
parameterName - the name of the parameter
SQLException - if a database error happenslong getLong(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happenslong getLong(String parameterName)
throws SQLException
parameterName - the name of the parameter
SQLException - if a database error happensObject getObject(int parameterIndex)
throws SQLException
Object.
The object type returned is the JDBC type registered for the parameter
with a registerOutParameter call. If a parameter was
registered as a java.sql.Types.OTHER then it may hold
abstract types that are particular to the connected database.
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if there is a problem accessing the databaseObject getObject(int parameterIndex,
Map<String,Class<?>> map)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1map - the Map holing the mapping from SQL types to Java classes
SQLException - if a database error happensObject getObject(String parameterName)
throws SQLException
The object type returned is the JDBC type registered for the parameter
with a registerOutParameter call. If a parameter was
registered as a java.sql.Types.OTHER then it may hold
abstract types that are particular to the connected database.
parameterName - the parameter name
Object representation of the value of the
parameter.
SQLException - if there is a problem accessing the databaseObject getObject(String parameterName,
Map<String,Class<?>> map)
throws SQLException
parameterName - the parameter namemap - the Map of SQL types to their Java counterparts
Object holding the value of the parameter.
SQLException - if there is a problem accessing the databaseRef getRef(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensRef getRef(String parameterName)
throws SQLException
parameterName - the parameter name
java.sql.Ref. A null reference is
returned for a parameter value of SQL NULL.
SQLException - if there is a problem accessing the databaseshort getShort(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensshort getShort(String parameterName)
throws SQLException
SMALLINT parameter as a
short
parameterName - the parameter name
short.
If the value is an SQL NULL then 0
(zero) is returned.
SQLException - if there is a problem accessing the databaseString getString(int parameterIndex)
throws SQLException
CHAR, VARCHAR
or LONGVARCHAR.
The string corresponding to a CHAR of fixed length will be
of identical length to the value in the database inclusive of padding
characters.
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if there is a problem accessing the databaseString getString(String parameterName)
throws SQLException
CHAR, VARCHAR or
LONGVARCHAR.
The string corresponding to a CHAR of fixed length will be
of identical length to the value in the database inclusive of padding
characters.
parameterName - the parameter name
SQLException - if there is a problem accessing the databaseTime getTime(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensTime getTime(int parameterIndex,
Calendar cal)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1cal - the Calendar to use in constructing the Time.
SQLException - if a database error happensTime getTime(String parameterName)
throws SQLException
TIME parameter as a
parameterName - the parameter name
java.sql.Time with the parameter value. A
null reference is returned for an SQL value of
NULL
SQLException - if a database error happensTime getTime(String parameterName,
Calendar cal)
throws SQLException
parameterName - the parameter namecal - used for creating the returned Time
java.sql.Time with the parameter value. A
null reference is returned for an SQL value of
NULL
SQLException - if a database error happensTimestamp getTimestamp(int parameterIndex)
throws SQLException
TIMESTAMP value as a
java.sql.Timestamp.
parameterIndex - the parameter number index, where the first parameter has
index 1
java.sql.Timestamp with the parameter value.
A null reference is returned for an SQL value of
NULL
SQLException - if a database error happensTimestamp getTimestamp(int parameterIndex,
Calendar cal)
throws SQLException
TIMESTAMP value as a
java.sql.Timestamp. The JDBC driver uses the supplied
Calendar to handle specific timezones and locales when
creating the result.
parameterIndex - the parameter number index, where the first parameter has
index 1cal - used for creating the returned Timestamp
java.sql.Timestamp with the parameter value.
A null reference is returned for an SQL value of
NULL
SQLException - if a database error happensTimestamp getTimestamp(String parameterName)
throws SQLException
TIMESTAMP value as a
java.sql.Timestamp.
parameterName - the parameter name
java.sql.Timestamp with the parameter value.
A null reference is returned for an SQL value of
NULL
SQLException - if a database error happensTimestamp getTimestamp(String parameterName,
Calendar cal)
throws SQLException
TIMESTAMP value as a
java.sql.Timestamp. The JDBC driver uses the supplied
Calendar to handle specific timezones and locales when
creating the result.
parameterName - the parameter namecal - used for creating the returned Timestamp
java.sql.Timestamp with the parameter value.
A null reference is returned for an SQL value of
NULL
SQLException - if a database error happensURL getURL(int parameterIndex)
throws SQLException
parameterIndex - the parameter number index, where the first parameter has
index 1
SQLException - if a database error happensURL getURL(String parameterName)
throws SQLException
DATALINK value in a new
Java java.net.URL.
parameterName - the parameter name
java.net.URL encapsulating the parameter
value. A null reference is returned for an SQL
value of NULL
SQLException - if a database error happensvoid registerOutParameter(int parameterIndex,
int sqlType)
throws SQLException
The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement. If a database specific type is expected for a parameter, the Type java.sql.Types.OTHER should be used. Note that there is another variant of this method for User Defined Types or a REF type.
parameterIndex - the parameter number index, where the first parameter has
index 1sqlType - the JDBC type as defined by java.sql.Types. The JDBC types
NUMERIC and DECIMAL should be defined using the version of
registerOutParameter that takes a
scale parameter.
SQLException - if a database error happensvoid registerOutParameter(int parameterIndex,
int sqlType,
int scale)
throws SQLException
The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement.
parameterIndex - the parameter number index, where the first parameter has
index 1sqlType - the JDBC type as defined by java.sql.Types.scale - the number of digits after the decimal point. Must be greater
than or equal to 0.
SQLException - if a database error happensvoid registerOutParameter(int paramIndex,
int sqlType,
String typeName)
throws SQLException
paramIndex - the parameter number index, where the first parameter has
index 1sqlType - a JDBC type expressed as a constant from TypestypeName - an SQL type name. For a REF type, this name should be the
fully qualified name of the referenced type.
SQLException - if a database error happensvoid registerOutParameter(String parameterName,
int sqlType)
throws SQLException
The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement. If a database specific type is expected for a parameter, the Type java.sql.Types.OTHER should be used. Note that there is another variant of this method for User Defined Types or a REF type.
parameterName - the parameter namesqlType - a JDBC type expressed as a constant from Types. Types
NUMERIC and DECIMAL should be defined using the variant of
this method that takes a scale parameter.
SQLException - if a database error happensvoid registerOutParameter(String parameterName,
int sqlType,
int scale)
throws SQLException
The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement.
parameterName - the parameter namesqlType - a JDBC type expressed as a constant from Typesscale - the number of digits after the decimal point. Must be greater
than or equal to 0.
SQLException - if a database error happensvoid registerOutParameter(String parameterName,
int sqlType,
String typeName)
throws SQLException
parameterName - the parameter namesqlType - a JDBC type expressed as a constant from TypestypeName - the fully qualified name of an SQL structured type. For a REF
type, this name should be the fully qualified name of the
referenced type.
SQLException - if a database error happensvoid setAsciiStream(String parameterName,
InputStream theInputStream,
int length)
throws SQLException
This is a good method for setting an SQL LONVARCHAR parameter where the length of the data is large. Data is read from the InputStream until end-of-file is reached or the specified number of bytes is copied.
parameterName - the parameter nametheInputStream - the ASCII InputStream carrying the data to update the
parameter withlength - the number of bytes in the InputStream to copy to the
parameter
SQLException - if a database error happensvoid setBigDecimal(String parameterName,
BigDecimal theBigDecimal)
throws SQLException
parameterName - the name of the parametertheBigDecimal - the java.math.BigInteger value to set
SQLException - if a database error happensvoid setBinaryStream(String parameterName,
InputStream theInputStream,
int length)
throws SQLException
Use this method when a large amount of data needs to be set into a LONGVARBINARY parameter.
parameterName - the name of the parametertheInputStream - the binary InputStream carrying the data to update the
parameterlength - the number of bytes in the InputStream to copy to the
parameter
SQLException - if a database error happensvoid setBoolean(String parameterName,
boolean theBoolean)
throws SQLException
parameterName - the parameter nametheBoolean - the new value with which to update the parameter
SQLException - if a database error happensvoid setByte(String parameterName,
byte theByte)
throws SQLException
parameterName - the parameter nametheByte - the new value with which to update the parameter
SQLException - if a database error happensvoid setBytes(String parameterName,
byte[] theBytes)
throws SQLException
VARBINARY or else
LONGVARBINARY in the connected database.
parameterName - the parameter nametheBytes - the new value with which to update the parameter
SQLException - if a database error happensvoid setCharacterStream(String parameterName,
Reader reader,
int length)
throws SQLException
parameterName - the parameter namereader - the new value with which to update the parameterlength - a count of the characters contained in reader
SQLException - if a database error happensvoid setDate(String parameterName,
Date theDate)
throws SQLException
parameterName - the parameter nametheDate - the new value with which to update the parameter
SQLException - if a database error happensvoid setDate(String parameterName,
Date theDate,
Calendar cal)
throws SQLException
parameterName - the parameter nametheDate - the new value with which to update the parametercal - a Calendar to use to construct the SQL DATE value
SQLException - if a database error happensvoid setDouble(String parameterName,
double theDouble)
throws SQLException
parameterName - the parameter nametheDouble - the new value with which to update the parameter
SQLException - if a database error happensvoid setFloat(String parameterName,
float theFloat)
throws SQLException
parameterName - the parameter nametheFloat - the new value with which to update the parameter
SQLException - if a database error happensvoid setInt(String parameterName,
int theInt)
throws SQLException
parameterName - the parameter nametheInt - the new value with which to update the parameter
SQLException - if a database error happensvoid setLong(String parameterName,
long theLong)
throws SQLException
parameterName - the parameter nametheLong - the new value with which to update the parameter
SQLException - if a database error happensvoid setNull(String parameterName,
int sqlType)
throws SQLException
parameterName - the parameter namesqlType - a JDBC type expressed as a constant from Types
SQLException - if a database error happensvoid setNull(String parameterName,
int sqlType,
String typeName)
throws SQLException
REF or user defined (e.g.
STRUCT, JAVA_OBJECT etc).
For reasons of portability, the caller is expected to supply both the SQL Type code and Type name (which is just the parameter name if the type is user defined, or the name of the type being referenced if a REF).
parameterName - the parameter namesqlType - a JDBC type expressed as a constant from TypestypeName - if the target parameter is a user defined type then this
should contain the full type name
the fully qualified name of a UDT or REF type - ignored if the parameter
is not a UDT.
SQLException - if a database error happensvoid setObject(String parameterName,
Object theObject)
throws SQLException
theObject
is transformed to the corresponding SQL type according to the normal Java
to SQL mapping rules.
If the object's class implements the interface SQLData, the JDBC driver
calls SQLData.writeSQL to write it to the SQL data stream.
If theObject implements any of the following interfaces
then it is the role of the driver to flow the value to the connected
database using the appropriate SQL type :
parameterName - the parameter nametheObject - the new value with which to update the parameter
SQLException - if a database error happensvoid setObject(String parameterName,
Object theObject,
int targetSqlType)
throws SQLException
The Object is converted to the given targetSqlType before it is sent to
the database. If the object has a custom mapping (its class implements
the interface SQLData), the JDBC driver will call the method
SQLData.writeSQL to write it to the SQL data stream. If
theObject implements any of the following interfaces then
it is the role of the driver to flow the value to the connected database
using the appropriate SQL type :
parameterName - the parameter nametheObject - the new value with which to update the parametertargetSqlType - a JDBC type expressed as a constant from Types
SQLException - if a database error happensvoid setObject(String parameterName,
Object theObject,
int targetSqlType,
int scale)
throws SQLException
The Object is converted to the given targetSqlType before it is sent to
the database. If the object has a custom mapping (its class implements
the interface SQLData), the JDBC driver will call the method
SQLData.writeSQL to write it to the SQL data stream. If
theObject implements any of the following interfaces then
it is the role of the driver to flow the value to the connected database
using the appropriate SQL type :
parameterName - the parameter nametheObject - the new value with which to update the parametertargetSqlType - a JDBC type expressed as a constant from Typesscale - where applicable, the number of digits after the decimal
point.
SQLException - if a database error happensvoid setShort(String parameterName,
short theShort)
throws SQLException
parameterName - the name of the parametertheShort - a short value to update the parameter
SQLException - if a database error happensvoid setString(String parameterName,
String theString)
throws SQLException
parameterName - the name of the parametertheString - a String value to update the parameter
SQLException - if a database error happensvoid setTime(String parameterName,
Time theTime)
throws SQLException
parameterName to the
value of the supplied java.sql.Time.
parameterName - the parameter nametheTime - the new value with which to update the parameter
SQLException - if a database error happensvoid setTime(String parameterName,
Time theTime,
Calendar cal)
throws SQLException
parameterName to the
value of the supplied java.sql.Time using the supplied
Calendar.
The driver uses the supplied Calendar to create the SQL TIME value, which allows it to use a custom timezone - otherwise the driver uses the default timezone of the Java virtual machine.
parameterName - the parameter nametheTime - the new value with which to update the parametercal - used for creating the new SQL TIME value
SQLException - if a database error happensvoid setTimestamp(String parameterName,
Timestamp theTimestamp)
throws SQLException
parameterName - the parameter nametheTimestamp - the new value with which to update the parameter
SQLException - if a database error happensvoid setTimestamp(String parameterName,
Timestamp theTimestamp,
Calendar cal)
throws SQLException
The driver uses the supplied Calendar to create the SQL TIMESTAMP value, which allows it to use a custom timezone - otherwise the driver uses the default timezone of the Java virtual machine.
parameterName - the parameter nametheTimestamp - the new value with which to update the parametercal - used for creating the new SQL TIME value
SQLException - if a database error happensvoid setURL(String parameterName,
URL theURL)
throws SQLException
parameterName - the parameter nametheURL - the new value with which to update the parameter
SQLException - if a database error happensboolean wasNull()
throws SQLException
SQLException - if a database error happens
|
Final | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||