PreparedStatementRepresents a prepared statement.
void addBatch(String sql) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
void addBatch() throws SQLExceptionAdds the current settings to the batch.void clearBatch() throws SQLExceptionClears the batch.void clearParameters() throws SQLExceptionClears all parameters.Throws:
SQLException - if this object is closed or invalid
void close() throws SQLExceptionCloses this statement. All result sets that where created by this statement become invalid after calling this method.boolean execute() throws SQLExceptionExecutes an arbitrary statement. If another result set exists for this statement, this will be closed (even if this statement fails). If auto commit is on, and the statement is not a select, this statement will be committed.Returns:
true if a result set is available, false if not
Throws:
SQLException - if this object is closed or invalid
boolean execute(String sql) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
boolean execute(String sql, int autoGeneratedKeys) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
boolean execute(String sql, int[] columnIndexes) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
boolean execute(String sql, String[] columnNames) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
int[] executeBatch() throws SQLExceptionExecutes the batch.Returns:
the array of update counts
ResultSet executeQuery() throws SQLExceptionExecutes a query (select statement) and returns the result set. If another result set exists for this statement, this will be closed (even if this statement fails).Returns:
the result set
Throws:
SQLException - if this object is closed or invalid
ResultSet executeQuery(String sql) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
int executeUpdate() throws SQLExceptionExecutes a statement (insert, update, delete, create, drop, commit, rollback) and returns the update count. If another result set exists for this statement, this will be closed (even if this statement fails). If the statement is a create or drop and does not throw an exception, the current transaction (if any) is committed after executing the statement. If auto commit is on, this statement will be committed.Returns:
the update count (number of row affected by an insert, update or
delete, or 0 if no rows or the statement was a create, drop,
commit or rollback)
Throws:
SQLException - if this object is closed or invalid
int executeUpdate(String sql) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
int executeUpdate(String sql, int autoGeneratedKeys) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
int executeUpdate(String sql, int[] columnIndexes) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
int executeUpdate(String sql, String[] columnNames) throws SQLExceptionCalling this method is not legal on a PreparedStatement.Throws:
SQLException - Unsupported Feature
ResultSetMetaData getMetaData() throws SQLExceptionGets the result set metadata of the query returned when the statement is executed. If this is not a query, this method returns null.Returns:
the meta data or null if this is not a query
Throws:
SQLException - if this object is closed
ParameterMetaData getParameterMetaData() throws SQLExceptionGet the parameter meta data of this prepared statement.Returns:
the meta data
void setArray(int parameterIndex, Array x) throws SQLException[Not supported] Sets the value of a parameter as a Array.void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLExceptionSets the value of a parameter as an ASCII stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
length - the number of bytes
Throws:
SQLException - if this object is closed
void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLExceptionSets the value of a parameter as an ASCII stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
length - the number of bytes
Throws:
SQLException - if this object is closed
void setAsciiStream(int parameterIndex, InputStream x) throws SQLExceptionSets the value of a parameter as an ASCII stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLExceptionSets the value of a parameter as an input stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
length - the number of bytes
Throws:
SQLException - if this object is closed
void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLExceptionSets the value of a parameter as an input stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
length - the number of bytes
Throws:
SQLException - if this object is closed
void setBinaryStream(int parameterIndex, InputStream x) throws SQLExceptionSets the value of a parameter as an input stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setBlob(int parameterIndex, Blob x) throws SQLExceptionSets the value of a parameter as a Blob.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setBlob(int parameterIndex, InputStream x) throws SQLExceptionSets the value of a parameter as a Blob.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setBlob(int parameterIndex, InputStream x, long length) throws SQLExceptionSets the value of a parameter as a Blob.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setBoolean(int parameterIndex, boolean x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setByte(int parameterIndex, byte x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setBytes(int parameterIndex, byte[] x) throws SQLExceptionSets the value of a parameter as a byte array.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setCharacterStream(int parameterIndex, Reader x, int length) throws SQLExceptionSets the value of a parameter as a character stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
length - the number of bytes
Throws:
SQLException - if this object is closed
void setCharacterStream(int parameterIndex, Reader x) throws SQLExceptionSets the value of a parameter as a character stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setCharacterStream(int parameterIndex, Reader x, long length) throws SQLExceptionSets the value of a parameter as a character stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
length - the number of bytes
Throws:
SQLException - if this object is closed
void setClob(int parameterIndex, Clob x) throws SQLExceptionSets the value of a parameter as a Clob.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setClob(int parameterIndex, Reader x) throws SQLExceptionSets the value of a parameter as a Clob.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setClob(int parameterIndex, Reader x, long length) throws SQLExceptionSets the value of a parameter as a Clob.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setDate(int parameterIndex, Date x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setDate(int parameterIndex, Date x, Calendar calendar) throws SQLExceptionSets the date using a specified time zone. The value will be converted to the local time zone.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
calendar - the calendar
Throws:
SQLException - if this object is closed
void setDouble(int parameterIndex, double x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setFloat(int parameterIndex, float x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setInt(int parameterIndex, int x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setLong(int parameterIndex, long x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setNCharacterStream(int parameterIndex, Reader x, long length) throws SQLExceptionSets the value of a parameter as a character stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
length - the number of bytes
Throws:
SQLException - if this object is closed
void setNCharacterStream(int parameterIndex, Reader x) throws SQLExceptionSets the value of a parameter as a character stream.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setNClob(int parameterIndex, Reader x) throws SQLExceptionSets the value of a parameter as a Clob.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setNClob(int parameterIndex, Reader x, long length) throws SQLExceptionSets the value of a parameter as a Clob.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setNString(int parameterIndex, String x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setNull(int parameterIndex, int sqlType) throws SQLExceptionSets a parameter to null.Parameters:
parameterIndex - the parameter index (1, 2, ...)
sqlType - the data type (Types.x)
Throws:
SQLException - if this object is closed
void setNull(int parameterIndex, int sqlType, String typeName) throws SQLExceptionSets a parameter to null.Parameters:
parameterIndex - the parameter index (1, 2, ...)
sqlType - the data type (Types.x)
typeName - this parameter is ignored
Throws:
SQLException - if this object is closed
void setObject(int parameterIndex, Object x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLExceptionSets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value, null is allowed
targetSqlType - the type as defined in java.sql.Types
Throws:
SQLException - if this object is closed
void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLExceptionSets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value, null is allowed
targetSqlType - the type as defined in java.sql.Types
scale - is ignored
Throws:
SQLException - if this object is closed
void setRef(int parameterIndex, Ref x) throws SQLException[Not supported] Sets the value of a column as a reference.void setShort(int parameterIndex, short x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setString(int parameterIndex, String x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setTime(int parameterIndex, Time x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setTime(int parameterIndex, Time x, Calendar calendar) throws SQLExceptionSets the time using a specified time zone. The value will be converted to the local time zone.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
calendar - the calendar
Throws:
SQLException - if this object is closed
void setTimestamp(int parameterIndex, Timestamp x) throws SQLExceptionSets the value of a parameter.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
Throws:
SQLException - if this object is closed
void setTimestamp(int parameterIndex, Timestamp x, Calendar calendar) throws SQLExceptionSets the timestamp using a specified time zone. The value will be converted to the local time zone.Parameters:
parameterIndex - the parameter index (1, 2, ...)
x - the value
calendar - the calendar
Throws:
SQLException - if this object is closed
void setURL(int parameterIndex, URL x) throws SQLException[Not supported]void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException[Not supported] This feature is deprecated and not supported. |