public class MariaDbCallableStatement extends Object implements CallableStatement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO| Constructor and Description |
|---|
MariaDbCallableStatement(MariaDbConnection connection,
String query)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch()
Adds a set of parameters to this
PreparedStatement
object's batch of send. |
void |
addBatch(String sql)
Adds the given SQL command to the current list of send for this
Statement object. |
void |
cancel() |
void |
clearBatch()
Empties this
Statement object's current list of
SQL send. |
void |
clearParameters()
Clears the current parameter values immediately.
|
void |
clearWarnings() |
void |
close()
Releases this
Statement object's database
and JDBC resources immediately instead of waiting for
this to happen when it is automatically closed. |
void |
closeOnCompletion() |
boolean |
execute()
Executes the SQL statement in this
PreparedStatement object,
which may be any kind of SQL statement. |
boolean |
execute(String sql) |
boolean |
execute(String sql,
int autoGeneratedKeys) |
boolean |
execute(String sql,
int[] columnIndexes) |
boolean |
execute(String sql,
String[] columnNames) |
int[] |
executeBatch()
Submits a batch of send to the database for execution and
if all send execute successfully, returns an array of update counts.
|
ResultSet |
executeQuery()
Executes the SQL statement in this
PreparedStatement object,
which may be any kind of SQL statement. |
ResultSet |
executeQuery(String sql) |
int |
executeUpdate()
Retrieves the current result as an update count;
if the result is a
ResultSet object or there are no more results, -1
is returned. |
int |
executeUpdate(String sql) |
int |
executeUpdate(String sql,
int autoGeneratedKeys) |
int |
executeUpdate(String sql,
int[] columnIndexes) |
int |
executeUpdate(String sql,
String[] columnNames) |
Array |
getArray(int parameterIndex) |
Array |
getArray(String parameterName) |
BigDecimal |
getBigDecimal(int parameterIndex) |
BigDecimal |
getBigDecimal(int parameterIndex,
int scale)
Deprecated.
use
getBigDecimal(int parameterIndex)
or getBigDecimal(String parameterName) |
BigDecimal |
getBigDecimal(String parameterName) |
Blob |
getBlob(int parameterIndex) |
Blob |
getBlob(String parameterName) |
boolean |
getBoolean(int parameterIndex) |
boolean |
getBoolean(String parameterName) |
byte |
getByte(int parameterIndex) |
byte |
getByte(String parameterName) |
byte[] |
getBytes(int parameterIndex) |
byte[] |
getBytes(String parameterName) |
Reader |
getCharacterStream(int parameterIndex) |
Reader |
getCharacterStream(String parameterName) |
Clob |
getClob(int parameterIndex) |
Clob |
getClob(String parameterName) |
Connection |
getConnection() |
Date |
getDate(int parameterIndex) |
Date |
getDate(int parameterIndex,
Calendar cal) |
Date |
getDate(String parameterName) |
Date |
getDate(String parameterName,
Calendar cal) |
double |
getDouble(int parameterIndex) |
double |
getDouble(String parameterName) |
int |
getFetchDirection() |
int |
getFetchSize() |
float |
getFloat(int parameterIndex) |
float |
getFloat(String parameterName) |
ResultSet |
getGeneratedKeys() |
int |
getInt(int parameterIndex) |
int |
getInt(String parameterName) |
long |
getLong(int parameterIndex) |
long |
getLong(String parameterName) |
int |
getMaxFieldSize() |
int |
getMaxRows() |
ResultSetMetaData |
getMetaData()
Retrieves the number, types and properties of
this
ResultSet object's columns. |
boolean |
getMoreResults() |
boolean |
getMoreResults(int current) |
Reader |
getNCharacterStream(int parameterIndex) |
Reader |
getNCharacterStream(String parameterName) |
NClob |
getNClob(int parameterIndex) |
NClob |
getNClob(String parameterName) |
String |
getNString(int parameterIndex) |
String |
getNString(String parameterName) |
Object |
getObject(int parameterIndex)
Gets the value of the designated column in the current row
of this
ResultSet object as
an Object in the Java programming language. |
<T> T |
getObject(int arg0,
Class<T> arg1) |
Object |
getObject(int parameterIndex,
Map<String,Class<?>> map) |
Object |
getObject(String parameterName) |
<T> T |
getObject(String arg0,
Class<T> arg1) |
Object |
getObject(String parameterName,
Map<String,Class<?>> map) |
ParameterMetaData |
getParameterMetaData() |
int |
getQueryTimeout() |
Ref |
getRef(int parameterIndex) |
Ref |
getRef(String parameterName) |
ResultSet |
getResultSet() |
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
RowId |
getRowId(int parameterIndex) |
RowId |
getRowId(String parameterName) |
short |
getShort(int parameterIndex) |
short |
getShort(String parameterName) |
SQLXML |
getSQLXML(int parameterIndex) |
SQLXML |
getSQLXML(String parameterName) |
String |
getString(int parameterIndex) |
String |
getString(String parameterName) |
Time |
getTime(int parameterIndex) |
Time |
getTime(int parameterIndex,
Calendar cal) |
Time |
getTime(String parameterName) |
Time |
getTime(String parameterName,
Calendar cal) |
Timestamp |
getTimestamp(int parameterIndex) |
Timestamp |
getTimestamp(int parameterIndex,
Calendar cal) |
Timestamp |
getTimestamp(String parameterName) |
Timestamp |
getTimestamp(String parameterName,
Calendar cal) |
int |
getUpdateCount() |
URL |
getURL(int parameterIndex) |
URL |
getURL(String parameterName) |
SQLWarning |
getWarnings() |
boolean |
isClosed() |
boolean |
isCloseOnCompletion() |
boolean |
isPoolable() |
boolean |
isWrapperFor(Class<?> iface) |
void |
registerOutParameter(int parameterIndex,
int sqlType) |
void |
registerOutParameter(int parameterIndex,
int sqlType,
int scale)
Registers the parameter in ordinal position
parameterIndex to be of JDBC type
sqlType. |
void |
registerOutParameter(int parameterIndex,
int sqlType,
String typeName)
Registers the designated output parameter.
|
void |
registerOutParameter(String parameterName,
int sqlType) |
void |
registerOutParameter(String parameterName,
int sqlType,
int scale) |
void |
registerOutParameter(String parameterName,
int sqlType,
String typeName) |
void |
setArray(int parameterIndex,
Array array) |
void |
setAsciiStream(int parameterIndex,
InputStream stream) |
void |
setAsciiStream(int parameterIndex,
InputStream stream,
int length) |
void |
setAsciiStream(int parameterIndex,
InputStream stream,
long length) |
void |
setAsciiStream(String parameterName,
InputStream stream) |
void |
setAsciiStream(String parameterName,
InputStream stream,
int length) |
void |
setAsciiStream(String parameterName,
InputStream stream,
long length) |
void |
setBigDecimal(int parameterIndex,
BigDecimal bigDecimal) |
void |
setBigDecimal(String parameterName,
BigDecimal bigDecimal) |
void |
setBinaryStream(int parameterIndex,
InputStream stream) |
void |
setBinaryStream(int parameterIndex,
InputStream stream,
int length) |
void |
setBinaryStream(int parameterIndex,
InputStream stream,
long length) |
void |
setBinaryStream(String parameterName,
InputStream stream) |
void |
setBinaryStream(String parameterName,
InputStream stream,
int length) |
void |
setBinaryStream(String parameterName,
InputStream stream,
long length) |
void |
setBlob(int parameterIndex,
Blob blob) |
void |
setBlob(int parameterIndex,
InputStream inputStream) |
void |
setBlob(int parameterIndex,
InputStream inputStream,
long length) |
void |
setBlob(String parameterName,
Blob blob) |
void |
setBlob(String parameterName,
InputStream inputStream) |
void |
setBlob(String parameterName,
InputStream inputStream,
long length) |
void |
setBoolean(int parameterIndex,
boolean bool) |
void |
setBoolean(String parameterName,
boolean bool) |
void |
setByte(int parameterIndex,
byte value) |
void |
setByte(String parameterName,
byte value) |
void |
setBytes(int parameterIndex,
byte[] bytes) |
void |
setBytes(String parameterName,
byte[] bytes) |
void |
setCharacterStream(int parameterIndex,
Reader reader) |
void |
setCharacterStream(int parameterIndex,
Reader reader,
int length) |
void |
setCharacterStream(int parameterIndex,
Reader reader,
long length) |
void |
setCharacterStream(String parameterName,
Reader reader) |
void |
setCharacterStream(String parameterName,
Reader reader,
int length) |
void |
setCharacterStream(String parameterName,
Reader reader,
long length) |
void |
setClob(int parameterIndex,
Clob clob) |
void |
setClob(int parameterIndex,
Reader reader) |
void |
setClob(int parameterIndex,
Reader reader,
long length) |
void |
setClob(String parameterName,
Clob clob) |
void |
setClob(String parameterName,
Reader reader) |
void |
setClob(String parameterName,
Reader reader,
long length) |
void |
setCursorName(String name) |
void |
setDate(int parameterIndex,
Date date) |
void |
setDate(int parameterIndex,
Date date,
Calendar cal) |
void |
setDate(String parameterName,
Date date) |
void |
setDate(String parameterName,
Date date,
Calendar cal) |
void |
setDouble(int parameterIndex,
double value) |
void |
setDouble(String parameterName,
double value) |
void |
setEscapeProcessing(boolean enable) |
void |
setFetchDirection(int direction) |
void |
setFetchSize(int rows) |
void |
setFloat(int parameterIndex,
float value) |
void |
setFloat(String parameterName,
float value) |
void |
setInt(int parameterIndex,
int value) |
void |
setInt(String parameterName,
int value) |
void |
setLong(int parameterIndex,
long value) |
void |
setLong(String parameterName,
long value) |
void |
setMaxFieldSize(int max) |
void |
setMaxRows(int max) |
void |
setNCharacterStream(int parameterIndex,
Reader value) |
void |
setNCharacterStream(int parameterIndex,
Reader value,
long length) |
void |
setNCharacterStream(String parameterName,
Reader value) |
void |
setNCharacterStream(String parameterName,
Reader value,
long length) |
void |
setNClob(int parameterIndex,
NClob value) |
void |
setNClob(int parameterIndex,
Reader reader) |
void |
setNClob(int parameterIndex,
Reader reader,
long length) |
void |
setNClob(String parameterName,
NClob value) |
void |
setNClob(String parameterName,
Reader reader) |
void |
setNClob(String parameterName,
Reader reader,
long length) |
void |
setNString(int parameterIndex,
String value) |
void |
setNString(String parameterName,
String value) |
void |
setNull(int parameterIndex,
int sqlType) |
void |
setNull(int parameterIndex,
int sqlType,
String typeName) |
void |
setNull(String parameterName,
int sqlType) |
void |
setNull(String parameterName,
int sqlType,
String typeName) |
void |
setObject(int parameterIndex,
Object obj) |
void |
setObject(int parameterIndex,
Object obj,
int targetSqlType) |
void |
setObject(int parameterIndex,
Object obj,
int targetSqlType,
int scaleOrLength) |
void |
setObject(String parameterName,
Object obj) |
void |
setObject(String parameterName,
Object obj,
int targetSqlType) |
void |
setObject(String parameterName,
Object obj,
int targetSqlType,
int scale) |
void |
setPoolable(boolean poolable) |
void |
setQueryTimeout(int seconds) |
void |
setRef(int parameterIndex,
Ref ref) |
void |
setRowId(int parameterIndex,
RowId rowid) |
void |
setRowId(String parameterName,
RowId rowid) |
void |
setShort(int parameterIndex,
short value) |
void |
setShort(String parameterName,
short value) |
void |
setSQLXML(int parameterIndex,
SQLXML xmlObject) |
void |
setSQLXML(String parameterName,
SQLXML xmlObject) |
void |
setString(int parameterIndex,
String str) |
void |
setString(String parameterName,
String str) |
void |
setTime(int parameterIndex,
Time time) |
void |
setTime(int parameterIndex,
Time time,
Calendar cal) |
void |
setTime(String parameterName,
Time time) |
void |
setTime(String parameterName,
Time time,
Calendar cal) |
void |
setTimestamp(int parameterIndex,
Timestamp timestamp) |
void |
setTimestamp(int parameterIndex,
Timestamp timestamp,
Calendar cal) |
void |
setTimestamp(String parameterName,
Timestamp timestamp) |
void |
setTimestamp(String parameterName,
Timestamp timestamp,
Calendar cal) |
void |
setUnicodeStream(int parameterIndex,
InputStream stream,
int length)
Deprecated.
Use
setCharacterStream |
void |
setURL(int parameterIndex,
URL url) |
void |
setURL(String parameterName,
URL val) |
<T> T |
unwrap(Class<T> iface) |
boolean |
wasNull() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitregisterOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setObject, setObjectexecuteLargeUpdate, setObject, setObjectexecuteLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, setLargeMaxRowspublic MariaDbCallableStatement(MariaDbConnection connection, String query) throws SQLException
connection - current connectionquery - querySQLException - exceptionpublic void registerOutParameter(int parameterIndex,
int sqlType)
throws SQLException
registerOutParameter in interface CallableStatementSQLExceptionpublic void registerOutParameter(int parameterIndex,
int sqlType,
int scale)
throws SQLException
parameterIndex to be of JDBC type
sqlType. All OUT parameters must be registered
before a stored procedure is executed.
The JDBC type specified by sqlType for an OUT
parameter determines the Java type that must be used
in the get method to read the value of that parameter.
This version of registerOutParameter should be
used when the parameter is of JDBC type NUMERIC
or DECIMAL.
registerOutParameter in interface CallableStatementparameterIndex - the first parameter is 1, the second is 2,
and so onsqlType - the SQL type code defined by java.sql.Types.scale - the desired number of digits to the right of the
decimal point. It must be greater than or equal to zero.SQLException - if the parameterIndex is not valid;
if a database access error occurs or
this method is called on a closed CallableStatementSQLFeatureNotSupportedException - if sqlType is
a ARRAY, BLOB, CLOB,
DATALINK, JAVA_OBJECT, NCHAR,
NCLOB, NVARCHAR, LONGNVARCHAR,
REF, ROWID, SQLXML
or STRUCT data type and the JDBC driver does not support
this data typeTypespublic void registerOutParameter(int parameterIndex,
int sqlType,
String typeName)
throws SQLException
registerOutParameter
should be used for a user-defined or REF output parameter. Examples
of user-defined types include: STRUCT, DISTINCT,
JAVA_OBJECT, and named array types.
All OUT parameters must be registered before a stored procedure is executed.
For a user-defined parameter, the fully-qualified SQL
type name of the parameter should also be given, while a REF
parameter requires that the fully-qualified type name of the
referenced type be given. A JDBC driver that does not need the
type code and type name information may ignore it. To be portable,
however, applications should always provide these values for
user-defined and REF parameters.
Although it is intended for user-defined and REF parameters,
this method may be used to register a parameter of any JDBC type.
If the parameter does not have a user-defined or REF type, the
typeName parameter is ignored.
Note: When reading the value of an out parameter, you must use the getter method whose Java type corresponds to the parameter's registered SQL type.
registerOutParameter in interface CallableStatementparameterIndex - the first parameter is 1, the second is 2,...sqlType - a value from TypestypeName - the fully-qualified name of an SQL structured typeSQLException - if the parameterIndex is not valid;
if a database access error occurs or
this method is called on a closed CallableStatementSQLFeatureNotSupportedException - if sqlType is
a ARRAY, BLOB, CLOB,
DATALINK, JAVA_OBJECT, NCHAR,
NCLOB, NVARCHAR, LONGNVARCHAR,
REF, ROWID, SQLXML
or STRUCT data type and the JDBC driver does not support
this data typeTypespublic void registerOutParameter(String parameterName, int sqlType) throws SQLException
registerOutParameter in interface CallableStatementSQLExceptionpublic void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException
registerOutParameter in interface CallableStatementSQLExceptionpublic void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException
registerOutParameter in interface CallableStatementSQLExceptionpublic boolean wasNull()
throws SQLException
wasNull in interface CallableStatementSQLExceptionpublic String getString(int parameterIndex) throws SQLException
getString in interface CallableStatementSQLExceptionpublic String getString(String parameterName) throws SQLException
getString in interface CallableStatementSQLExceptionpublic boolean getBoolean(int parameterIndex)
throws SQLException
getBoolean in interface CallableStatementSQLExceptionpublic boolean getBoolean(String parameterName) throws SQLException
getBoolean in interface CallableStatementSQLExceptionpublic byte getByte(int parameterIndex)
throws SQLException
getByte in interface CallableStatementSQLExceptionpublic byte getByte(String parameterName) throws SQLException
getByte in interface CallableStatementSQLExceptionpublic short getShort(int parameterIndex)
throws SQLException
getShort in interface CallableStatementSQLExceptionpublic short getShort(String parameterName) throws SQLException
getShort in interface CallableStatementSQLExceptionpublic int getInt(int parameterIndex)
throws SQLException
getInt in interface CallableStatementSQLExceptionpublic int getInt(String parameterName) throws SQLException
getInt in interface CallableStatementSQLExceptionpublic long getLong(int parameterIndex)
throws SQLException
getLong in interface CallableStatementSQLExceptionpublic long getLong(String parameterName) throws SQLException
getLong in interface CallableStatementSQLExceptionpublic float getFloat(int parameterIndex)
throws SQLException
getFloat in interface CallableStatementSQLExceptionpublic float getFloat(String parameterName) throws SQLException
getFloat in interface CallableStatementSQLExceptionpublic double getDouble(int parameterIndex)
throws SQLException
getDouble in interface CallableStatementSQLExceptionpublic double getDouble(String parameterName) throws SQLException
getDouble in interface CallableStatementSQLException@Deprecated public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException
getBigDecimal(int parameterIndex)
or getBigDecimal(String parameterName)getBigDecimal in interface CallableStatementSQLExceptionpublic BigDecimal getBigDecimal(int parameterIndex) throws SQLException
getBigDecimal in interface CallableStatementSQLExceptionpublic BigDecimal getBigDecimal(String parameterName) throws SQLException
getBigDecimal in interface CallableStatementSQLExceptionpublic byte[] getBytes(int parameterIndex)
throws SQLException
getBytes in interface CallableStatementSQLExceptionpublic byte[] getBytes(String parameterName) throws SQLException
getBytes in interface CallableStatementSQLExceptionpublic Date getDate(int parameterIndex) throws SQLException
getDate in interface CallableStatementSQLExceptionpublic Date getDate(int parameterIndex, Calendar cal) throws SQLException
getDate in interface CallableStatementSQLExceptionpublic Date getDate(String parameterName) throws SQLException
getDate in interface CallableStatementSQLExceptionpublic Date getDate(String parameterName, Calendar cal) throws SQLException
getDate in interface CallableStatementSQLExceptionpublic Time getTime(int parameterIndex) throws SQLException
getTime in interface CallableStatementSQLExceptionpublic Time getTime(int parameterIndex, Calendar cal) throws SQLException
getTime in interface CallableStatementSQLExceptionpublic Time getTime(String parameterName) throws SQLException
getTime in interface CallableStatementSQLExceptionpublic Time getTime(String parameterName, Calendar cal) throws SQLException
getTime in interface CallableStatementSQLExceptionpublic Timestamp getTimestamp(int parameterIndex) throws SQLException
getTimestamp in interface CallableStatementSQLExceptionpublic Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException
getTimestamp in interface CallableStatementSQLExceptionpublic Timestamp getTimestamp(String parameterName) throws SQLException
getTimestamp in interface CallableStatementSQLExceptionpublic Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
getTimestamp in interface CallableStatementSQLExceptionpublic Object getObject(int parameterIndex) throws SQLException
Gets the value of the designated column in the current row
of this ResultSet object as
an Object in the Java programming language.
This method will return the value of the given column as a
Java object. The type of the Java object will be the default
Java object type corresponding to the column's SQL type,
following the mapping for built-in types specified in the JDBC
specification. If the value is an SQL NULL,
the driver returns a Java null.
This method may also be used to read database-specific
abstract data types.
In the JDBC 2.0 API, the behavior of method
getObject is extended to materialize
data of SQL user-defined types.
If Connection.getTypeMap does not throw a
SQLFeatureNotSupportedException,
then when a column contains a structured or distinct value,
the behavior of this method is as
if it were a call to: getObject(columnIndex,
this.getStatement().getConnection().getTypeMap()).
If Connection.getTypeMap does throw a
SQLFeatureNotSupportedException,
then structured values are not supported, and distinct values
are mapped to the default Java class as determined by the
underlying SQL type of the DISTINCT type.
getObject in interface CallableStatementparameterIndex - the first column is 1, the second is 2, ...java.lang.Object holding the column valueSQLException - if the columnIndex is not valid;
if a database access error occurs or this method is
called on a closed result setpublic Object getObject(int parameterIndex, Map<String,Class<?>> map) throws SQLException
getObject in interface CallableStatementSQLExceptionpublic Object getObject(String parameterName) throws SQLException
getObject in interface CallableStatementSQLExceptionpublic Object getObject(String parameterName, Map<String,Class<?>> map) throws SQLException
getObject in interface CallableStatementSQLExceptionpublic <T> T getObject(int arg0,
Class<T> arg1)
throws SQLException
getObject in interface CallableStatementSQLExceptionpublic <T> T getObject(String arg0, Class<T> arg1) throws SQLException
getObject in interface CallableStatementSQLExceptionpublic Ref getRef(int parameterIndex) throws SQLException
getRef in interface CallableStatementSQLExceptionpublic Ref getRef(String parameterName) throws SQLException
getRef in interface CallableStatementSQLExceptionpublic Blob getBlob(int parameterIndex) throws SQLException
getBlob in interface CallableStatementSQLExceptionpublic Blob getBlob(String parameterName) throws SQLException
getBlob in interface CallableStatementSQLExceptionpublic Clob getClob(int parameterIndex) throws SQLException
getClob in interface CallableStatementSQLExceptionpublic Clob getClob(String parameterName) throws SQLException
getClob in interface CallableStatementSQLExceptionpublic Array getArray(int parameterIndex) throws SQLException
getArray in interface CallableStatementSQLExceptionpublic Array getArray(String parameterName) throws SQLException
getArray in interface CallableStatementSQLExceptionpublic URL getURL(int parameterIndex) throws SQLException
getURL in interface CallableStatementSQLExceptionpublic URL getURL(String parameterName) throws SQLException
getURL in interface CallableStatementSQLExceptionpublic void setURL(String parameterName, URL val) throws SQLException
setURL in interface CallableStatementSQLExceptionpublic void setURL(int parameterIndex,
URL url)
throws SQLException
setURL in interface PreparedStatementSQLExceptionpublic void setNull(String parameterName, int sqlType) throws SQLException
setNull in interface CallableStatementSQLExceptionpublic void setNull(int parameterIndex,
int sqlType)
throws SQLException
setNull in interface PreparedStatementSQLExceptionpublic void setNull(int parameterIndex,
int sqlType,
String typeName)
throws SQLException
setNull in interface PreparedStatementSQLExceptionpublic void setNull(String parameterName, int sqlType, String typeName) throws SQLException
setNull in interface CallableStatementSQLExceptionpublic void setBoolean(int parameterIndex,
boolean bool)
throws SQLException
setBoolean in interface PreparedStatementSQLExceptionpublic void setBoolean(String parameterName, boolean bool) throws SQLException
setBoolean in interface CallableStatementSQLExceptionpublic void setByte(String parameterName, byte value) throws SQLException
setByte in interface CallableStatementSQLExceptionpublic void setByte(int parameterIndex,
byte value)
throws SQLException
setByte in interface PreparedStatementSQLExceptionpublic void setShort(String parameterName, short value) throws SQLException
setShort in interface CallableStatementSQLExceptionpublic void setShort(int parameterIndex,
short value)
throws SQLException
setShort in interface PreparedStatementSQLExceptionpublic void setInt(String parameterName, int value) throws SQLException
setInt in interface CallableStatementSQLExceptionpublic void setInt(int parameterIndex,
int value)
throws SQLException
setInt in interface PreparedStatementSQLExceptionpublic void setLong(String parameterName, long value) throws SQLException
setLong in interface CallableStatementSQLExceptionpublic void setLong(int parameterIndex,
long value)
throws SQLException
setLong in interface PreparedStatementSQLExceptionpublic void setFloat(String parameterName, float value) throws SQLException
setFloat in interface CallableStatementSQLExceptionpublic void setFloat(int parameterIndex,
float value)
throws SQLException
setFloat in interface PreparedStatementSQLExceptionpublic void setDouble(String parameterName, double value) throws SQLException
setDouble in interface CallableStatementSQLExceptionpublic void setDouble(int parameterIndex,
double value)
throws SQLException
setDouble in interface PreparedStatementSQLExceptionpublic void setBigDecimal(String parameterName, BigDecimal bigDecimal) throws SQLException
setBigDecimal in interface CallableStatementSQLExceptionpublic void setBigDecimal(int parameterIndex,
BigDecimal bigDecimal)
throws SQLException
setBigDecimal in interface PreparedStatementSQLExceptionpublic void setString(String parameterName, String str) throws SQLException
setString in interface CallableStatementSQLExceptionpublic void setString(int parameterIndex,
String str)
throws SQLException
setString in interface PreparedStatementSQLExceptionpublic void setBytes(String parameterName, byte[] bytes) throws SQLException
setBytes in interface CallableStatementSQLExceptionpublic void setBytes(int parameterIndex,
byte[] bytes)
throws SQLException
setBytes in interface PreparedStatementSQLExceptionpublic void setDate(String parameterName, Date date, Calendar cal) throws SQLException
setDate in interface CallableStatementSQLExceptionpublic void setDate(int parameterIndex,
Date date)
throws SQLException
setDate in interface PreparedStatementSQLExceptionpublic void setDate(int parameterIndex,
Date date,
Calendar cal)
throws SQLException
setDate in interface PreparedStatementSQLExceptionpublic void setDate(String parameterName, Date date) throws SQLException
setDate in interface CallableStatementSQLExceptionpublic void setTime(String parameterName, Time time, Calendar cal) throws SQLException
setTime in interface CallableStatementSQLExceptionpublic void setTime(int parameterIndex,
Time time)
throws SQLException
setTime in interface PreparedStatementSQLExceptionpublic void setTime(int parameterIndex,
Time time,
Calendar cal)
throws SQLException
setTime in interface PreparedStatementSQLExceptionpublic void setTime(String parameterName, Time time) throws SQLException
setTime in interface CallableStatementSQLExceptionpublic void setTimestamp(String parameterName, Timestamp timestamp) throws SQLException
setTimestamp in interface CallableStatementSQLExceptionpublic void setTimestamp(String parameterName, Timestamp timestamp, Calendar cal) throws SQLException
setTimestamp in interface CallableStatementSQLExceptionpublic void setTimestamp(int parameterIndex,
Timestamp timestamp)
throws SQLException
setTimestamp in interface PreparedStatementSQLExceptionpublic void setTimestamp(int parameterIndex,
Timestamp timestamp,
Calendar cal)
throws SQLException
setTimestamp in interface PreparedStatementSQLExceptionpublic void setAsciiStream(String parameterName, InputStream stream, int length) throws SQLException
setAsciiStream in interface CallableStatementSQLExceptionpublic void setAsciiStream(String parameterName, InputStream stream, long length) throws SQLException
setAsciiStream in interface CallableStatementSQLExceptionpublic void setAsciiStream(String parameterName, InputStream stream) throws SQLException
setAsciiStream in interface CallableStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream stream,
int length)
throws SQLException
setAsciiStream in interface PreparedStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream stream,
long length)
throws SQLException
setAsciiStream in interface PreparedStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream stream)
throws SQLException
setAsciiStream in interface PreparedStatementSQLExceptionpublic void setBinaryStream(String parameterName, InputStream stream, int length) throws SQLException
setBinaryStream in interface CallableStatementSQLExceptionpublic void setBinaryStream(String parameterName, InputStream stream, long length) throws SQLException
setBinaryStream in interface CallableStatementSQLExceptionpublic void setBinaryStream(String parameterName, InputStream stream) throws SQLException
setBinaryStream in interface CallableStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream stream,
int length)
throws SQLException
setBinaryStream in interface PreparedStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream stream,
long length)
throws SQLException
setBinaryStream in interface PreparedStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream stream)
throws SQLException
setBinaryStream in interface PreparedStatementSQLExceptionpublic void setObject(String parameterName, Object obj, int targetSqlType, int scale) throws SQLException
setObject in interface CallableStatementSQLExceptionpublic void setObject(String parameterName, Object obj, int targetSqlType) throws SQLException
setObject in interface CallableStatementSQLExceptionpublic void setObject(String parameterName, Object obj) throws SQLException
setObject in interface CallableStatementSQLExceptionpublic void setObject(int parameterIndex,
Object obj,
int targetSqlType)
throws SQLException
setObject in interface PreparedStatementSQLExceptionpublic void setObject(int parameterIndex,
Object obj)
throws SQLException
setObject in interface PreparedStatementSQLExceptionpublic void setObject(int parameterIndex,
Object obj,
int targetSqlType,
int scaleOrLength)
throws SQLException
setObject in interface PreparedStatementSQLExceptionpublic void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException
setCharacterStream in interface CallableStatementSQLExceptionpublic void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException
setCharacterStream in interface CallableStatementSQLExceptionpublic void setCharacterStream(String parameterName, Reader reader) throws SQLException
setCharacterStream in interface CallableStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader,
int length)
throws SQLException
setCharacterStream in interface PreparedStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader,
long length)
throws SQLException
setCharacterStream in interface PreparedStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader)
throws SQLException
setCharacterStream in interface PreparedStatementSQLExceptionpublic RowId getRowId(int parameterIndex) throws SQLException
getRowId in interface CallableStatementSQLExceptionpublic RowId getRowId(String parameterName) throws SQLException
getRowId in interface CallableStatementSQLExceptionpublic void setRowId(String parameterName, RowId rowid) throws SQLException
setRowId in interface CallableStatementSQLExceptionpublic void setRowId(int parameterIndex,
RowId rowid)
throws SQLException
setRowId in interface PreparedStatementSQLExceptionpublic void setNString(String parameterName, String value) throws SQLException
setNString in interface CallableStatementSQLExceptionpublic void setNString(int parameterIndex,
String value)
throws SQLException
setNString in interface PreparedStatementSQLExceptionpublic void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
setNCharacterStream in interface CallableStatementSQLExceptionpublic void setNCharacterStream(String parameterName, Reader value) throws SQLException
setNCharacterStream in interface CallableStatementSQLExceptionpublic void setNCharacterStream(int parameterIndex,
Reader value,
long length)
throws SQLException
setNCharacterStream in interface PreparedStatementSQLExceptionpublic void setNCharacterStream(int parameterIndex,
Reader value)
throws SQLException
setNCharacterStream in interface PreparedStatementSQLExceptionpublic void setNClob(String parameterName, NClob value) throws SQLException
setNClob in interface CallableStatementSQLExceptionpublic void setNClob(String parameterName, Reader reader, long length) throws SQLException
setNClob in interface CallableStatementSQLExceptionpublic void setNClob(String parameterName, Reader reader) throws SQLException
setNClob in interface CallableStatementSQLExceptionpublic void setNClob(int parameterIndex,
NClob value)
throws SQLException
setNClob in interface PreparedStatementSQLExceptionpublic void setNClob(int parameterIndex,
Reader reader,
long length)
throws SQLException
setNClob in interface PreparedStatementSQLExceptionpublic void setNClob(int parameterIndex,
Reader reader)
throws SQLException
setNClob in interface PreparedStatementSQLExceptionpublic void setClob(int parameterIndex,
Clob clob)
throws SQLException
setClob in interface PreparedStatementSQLExceptionpublic void setClob(String parameterName, Reader reader, long length) throws SQLException
setClob in interface CallableStatementSQLExceptionpublic void setClob(String parameterName, Clob clob) throws SQLException
setClob in interface CallableStatementSQLExceptionpublic void setClob(String parameterName, Reader reader) throws SQLException
setClob in interface CallableStatementSQLExceptionpublic void setClob(int parameterIndex,
Reader reader,
long length)
throws SQLException
setClob in interface PreparedStatementSQLExceptionpublic void setClob(int parameterIndex,
Reader reader)
throws SQLException
setClob in interface PreparedStatementSQLExceptionpublic void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
setBlob in interface CallableStatementSQLExceptionpublic void setBlob(String parameterName, Blob blob) throws SQLException
setBlob in interface CallableStatementSQLExceptionpublic void setBlob(int parameterIndex,
Blob blob)
throws SQLException
setBlob in interface PreparedStatementSQLExceptionpublic void setBlob(int parameterIndex,
InputStream inputStream,
long length)
throws SQLException
setBlob in interface PreparedStatementSQLExceptionpublic void setBlob(int parameterIndex,
InputStream inputStream)
throws SQLException
setBlob in interface PreparedStatementSQLExceptionpublic void setBlob(String parameterName, InputStream inputStream) throws SQLException
setBlob in interface CallableStatementSQLExceptionpublic NClob getNClob(int parameterIndex) throws SQLException
getNClob in interface CallableStatementSQLExceptionpublic NClob getNClob(String parameterName) throws SQLException
getNClob in interface CallableStatementSQLExceptionpublic void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
setSQLXML in interface CallableStatementSQLExceptionpublic void setSQLXML(int parameterIndex,
SQLXML xmlObject)
throws SQLException
setSQLXML in interface PreparedStatementSQLExceptionpublic SQLXML getSQLXML(int parameterIndex) throws SQLException
getSQLXML in interface CallableStatementSQLExceptionpublic SQLXML getSQLXML(String parameterName) throws SQLException
getSQLXML in interface CallableStatementSQLExceptionpublic String getNString(int parameterIndex) throws SQLException
getNString in interface CallableStatementSQLExceptionpublic String getNString(String parameterName) throws SQLException
getNString in interface CallableStatementSQLExceptionpublic Reader getNCharacterStream(int parameterIndex) throws SQLException
getNCharacterStream in interface CallableStatementSQLExceptionpublic Reader getNCharacterStream(String parameterName) throws SQLException
getNCharacterStream in interface CallableStatementSQLExceptionpublic Reader getCharacterStream(int parameterIndex) throws SQLException
getCharacterStream in interface CallableStatementSQLExceptionpublic Reader getCharacterStream(String parameterName) throws SQLException
getCharacterStream in interface CallableStatementSQLExceptionpublic ResultSet executeQuery() throws SQLException
PreparedStatement object,
which may be any kind of SQL statement.
Some prepared statements return multiple results; the execute
method handles these complex statements as well as the simpler
form of statements handled by the methods executeQuery
and executeUpdate.
The execute method returns a boolean to
indicate the form of the first result. You must call either the method
getResultSet or getUpdateCount
to retrieve the result; you must call getInternalMoreResults to
move to any subsequent result(s).
executeQuery in interface PreparedStatementtrue if the first result is a ResultSet
object; false if the first result is an update
count or there is no resultSQLException - if a database access error occurs;
this method is called on a closed PreparedStatement
or an argument is supplied to this methodSQLTimeoutException - when the driver has determined that the
timeout value that was specified by the setQueryTimeout
method has been exceeded and has at least attempted to cancel
the currently running StatementStatement.execute(java.lang.String),
Statement.getResultSet(),
Statement.getUpdateCount(),
Statement.getMoreResults()public ResultSet executeQuery(String sql) throws SQLException
executeQuery in interface StatementSQLExceptionpublic int executeUpdate()
throws SQLException
ResultSet object or there are no more results, -1
is returned. This method should be called only once per result.executeUpdate in interface PreparedStatementResultSet object or there are no more resultsSQLException - if a database access error occurs or
this method is called on a closed Statementexecute()public int executeUpdate(String sql) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate in interface StatementSQLException@Deprecated public void setUnicodeStream(int parameterIndex, InputStream stream, int length) throws SQLException
setCharacterStreamsetUnicodeStream in interface PreparedStatementSQLExceptionpublic void clearParameters()
throws SQLException
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.
clearParameters in interface PreparedStatementSQLExceptionpublic SQLWarning getWarnings() throws SQLException
getWarnings in interface StatementSQLExceptionpublic boolean execute()
throws SQLException
PreparedStatement object,
which may be any kind of SQL statement.
Some prepared statements return multiple results; the execute
method handles these complex statements as well as the simpler
form of statements handled by the methods executeQuery
and executeUpdate.
The execute method returns a boolean to
indicate the form of the first result. You must call either the method
getResultSet or getUpdateCount
to retrieve the result; you must call getInternalMoreResults to
move to any subsequent result(s).
execute in interface PreparedStatementtrue if the first result is a ResultSet
object; false if the first result is an update
count or there is no resultSQLException - if a database access error occurs;
this method is called on a closed PreparedStatement
or an argument is supplied to this methodSQLTimeoutException - when the driver has determined that the
timeout value that was specified by the setQueryTimeout
method has been exceeded and has at least attempted to cancel
the currently running StatementStatement.execute(java.lang.String),
Statement.getResultSet(),
Statement.getUpdateCount(),
Statement.getMoreResults()public boolean execute(String sql) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, int[] columnIndexes) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, String[] columnNames) throws SQLException
execute in interface StatementSQLExceptionpublic void addBatch()
throws SQLException
PreparedStatement
object's batch of send.addBatch in interface PreparedStatementSQLException - if a database access error occurs or
this method is called on a closed PreparedStatementStatement.addBatch(java.lang.String)public void addBatch(String sql) throws SQLException
Statement object. The send in this list can be
executed as a batch by calling the method executeBatch.
Note:This method cannot be called on a
PreparedStatement or CallableStatement.
addBatch in interface Statementsql - typically this is a SQL INSERT or
UPDATE statementSQLException - if a database access error occurs,
this method is called on a closed Statement, the
driver does not support batch updates, the method is called on a
PreparedStatement or CallableStatementexecuteBatch(),
DatabaseMetaData.supportsBatchUpdates()public void setRef(int parameterIndex,
Ref ref)
throws SQLException
setRef in interface PreparedStatementSQLExceptionpublic void setArray(int parameterIndex,
Array array)
throws SQLException
setArray in interface PreparedStatementSQLExceptionpublic ParameterMetaData getParameterMetaData() throws SQLException
getParameterMetaData in interface PreparedStatementSQLExceptionpublic ResultSetMetaData getMetaData() throws SQLException
ResultSet object's columns.getMetaData in interface PreparedStatementResultSet object's columnsSQLException - if a database access error occurs or this method is
called on a closed result setpublic void close()
throws SQLException
Statement 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 Statement
object that is already closed has no effect.
Note:When a Statement object is
closed, its current ResultSet object, if one exists, is
also closed.
close in interface AutoCloseableclose in interface StatementSQLException - if a database access error occurspublic int getMaxFieldSize()
throws SQLException
getMaxFieldSize in interface StatementSQLExceptionpublic void setMaxFieldSize(int max)
throws SQLException
setMaxFieldSize in interface StatementSQLExceptionpublic int getMaxRows()
throws SQLException
getMaxRows in interface StatementSQLExceptionpublic void setMaxRows(int max)
throws SQLException
setMaxRows in interface StatementSQLExceptionpublic void setEscapeProcessing(boolean enable)
throws SQLException
setEscapeProcessing in interface StatementSQLExceptionpublic int getQueryTimeout()
throws SQLException
getQueryTimeout in interface StatementSQLExceptionpublic void setQueryTimeout(int seconds)
throws SQLException
setQueryTimeout in interface StatementSQLExceptionpublic void cancel()
throws SQLException
cancel in interface StatementSQLExceptionpublic void clearWarnings()
throws SQLException
clearWarnings in interface StatementSQLExceptionpublic void setCursorName(String name) throws SQLException
setCursorName in interface StatementSQLExceptionpublic ResultSet getResultSet() throws SQLException
getResultSet in interface StatementSQLExceptionpublic int getUpdateCount()
throws SQLException
getUpdateCount in interface StatementSQLExceptionpublic boolean getMoreResults()
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic boolean getMoreResults(int current)
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic int getFetchDirection()
throws SQLException
getFetchDirection in interface StatementSQLExceptionpublic void setFetchDirection(int direction)
throws SQLException
setFetchDirection in interface StatementSQLExceptionpublic int getFetchSize()
throws SQLException
getFetchSize in interface StatementSQLExceptionpublic void setFetchSize(int rows)
throws SQLException
setFetchSize in interface StatementSQLExceptionpublic int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency in interface StatementSQLExceptionpublic int getResultSetType()
throws SQLException
getResultSetType in interface StatementSQLExceptionpublic void clearBatch()
throws SQLException
Statement object's current list of
SQL send.clearBatch in interface StatementSQLException - if a database access error occurs,
this method is called on a closed Statement or the
driver does not support batch updatesaddBatch(),
DatabaseMetaData.supportsBatchUpdates()public int[] executeBatch()
throws SQLException
int elements of the array that is returned are ordered
to correspond to the send in the batch, which are ordered
according to the order in which they were added to the batch.
The elements in the array returned by the method executeBatch
may be one of the following:
SUCCESS_NO_INFO -- indicates that the command was
processed successfully but that the number of rows affected is
unknown
If one of the send in a batch update fails to execute properly,
this method throws a BatchUpdateException, and a JDBC
driver may or may not continue to process the remaining send in
the batch. However, the driver's behavior must be consistent with a
particular DBMS, either always continuing to process send or never
continuing to process send. If the driver continues processing
after a failure, the array returned by the method
BatchUpdateException.getUpdateCounts
will contain as many elements as there are send in the batch, and
at least one of the elements will be the following:
EXECUTE_FAILED -- indicates that the command failed
to execute successfully and occurs only if a driver continues to
process send after a command fails
The possible implementations and return values have been modified in
the Java 2 SDK, Standard Edition, version 1.3 to
accommodate the option of continuing to process send in a batch
update after a BatchUpdateException object has been thrown.
executeBatch in interface StatementSQLException - if a database access error occurs,
this method is called on a closed Statement or the
driver does not support batch statements. Throws BatchUpdateException
(a subclass of SQLException) if one of the send sent to the
database fails to execute properly or attempts to return a result set.SQLTimeoutException - when the driver has determined that the
timeout value that was specified by the setQueryTimeout
method has been exceeded and has at least attempted to cancel
the currently running StatementaddBatch(),
DatabaseMetaData.supportsBatchUpdates()public Connection getConnection() throws SQLException
getConnection in interface StatementSQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
getGeneratedKeys in interface StatementSQLExceptionpublic int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLExceptionpublic boolean isClosed()
throws SQLException
isClosed in interface StatementSQLExceptionpublic boolean isPoolable()
throws SQLException
isPoolable in interface StatementSQLExceptionpublic void setPoolable(boolean poolable)
throws SQLException
setPoolable in interface StatementSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic void closeOnCompletion()
throws SQLException
closeOnCompletion in interface StatementSQLExceptionpublic boolean isCloseOnCompletion()
throws SQLException
isCloseOnCompletion in interface StatementSQLExceptionCopyright © 2015. All rights reserved.