Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface PreparedStatement
extends Statement
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 | |
void |
|
void |
|
boolean |
|
ResultSet |
|
int |
|
ResultSetMetaData |
|
ParameterMetaData |
|
void | |
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void | |
void | |
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void | |
void | |
void | |
void | |
void |
|
void | |
void | |
void | |
void |
|
void |
|
void | |
void |
|
Methods inherited from interface java.lang.AutoCloseable | |
close |
public void addBatch() throws SQLException
This method adds a set of parameters to the batch for JDBC 2.0.
- Throws:
SQLException
- If an error occurs.
public void clearParameters() throws SQLException
This method clears all of the input parameter that have been set on this statement.
- Throws:
SQLException
- If an error occurs.
public boolean execute() throws SQLException
This method executes a prepared SQL query. Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.
- Returns:
- The result of the SQL statement.
- Throws:
SQLException
- If an error occurs.
public ResultSet executeQuery() throws SQLException
This method executes a prepared SQL query and returns its ResultSet.
- Returns:
- The ResultSet of the SQL statement.
- Throws:
SQLException
- If an error occurs.
public int executeUpdate() throws SQLException
This method executes an SQL INSERT, UPDATE or DELETE statement. SQL statements that return nothing such as SQL DDL statements can be executed.
- Returns:
- The result is either the row count for INSERT, UPDATE or DELETE statements; or 0 for SQL statements that return nothing.
- Throws:
SQLException
- If an error occurs.
public ResultSetMetaData getMetaData() throws SQLException
This method returns meta data for the result set from this statement.
- Returns:
- Meta data for the result set from this statement.
- Throws:
SQLException
- If an error occurs.
public ParameterMetaData getParameterMetaData() throws SQLException
Returns information about the parameters set on thisPreparedStatement
(seeParameterMetaData
for a detailed description of the provided information).
- Returns:
- Meta data for the parameters of this statement.
- Since:
- 1.4
- See Also:
ParameterMetaData
public void setArray(int index, Array value) throws SQLException
This method sets the specified parameter from the given JavaArray
value. The default object type to SQL type mapping will be used.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setAsciiStream(int index, InputStream stream, int count) throws SQLException
This method sets the specified parameter from the given Java ASCIIInputStream
value.
- Parameters:
index
- The index of the parameter value to set.stream
- The stream from which the parameter value is read.count
- The number of bytes in the stream.
- Throws:
SQLException
- If an error occurs.
public void setBigDecimal(int index, BigDecimal value) throws SQLException
This method sets the specified parameter from the given Javajava.math.BigDecimal
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setBinaryStream(int index, InputStream stream, int count) throws SQLException
This method sets the specified parameter from the given Java binaryInputStream
value.
- Parameters:
index
- The index of the parameter value to set.stream
- The stream from which the parameter value is read.count
- The number of bytes in the stream.
- Throws:
SQLException
- If an error occurs.
public void setBlob(int index, Blob value) throws SQLException
This method sets the specified parameter from the given JavaBlob
value. The default object type to SQL type mapping will be used.
- Parameters:
index
- The index of the parameter value to set.value
- TheBlob
used to set the value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setBoolean(int index, boolean value) throws SQLException
This method sets the specified parameter from the given Javaboolean
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setByte(int index, byte value) throws SQLException
This method sets the specified parameter from the given Javabyte
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setBytes(int index, byte[] value) throws SQLException
This method sets the specified parameter from the given Javabyte
array value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setCharacterStream(int index, Reader reader, int count) throws SQLException
This method sets the specified parameter from the given Java characterReader
value.
- Parameters:
index
- The index of the parameter value to set.reader
- The reader from which the parameter value is read.count
- The number of characters in the stream.
- Throws:
SQLException
- If an error occurs.
public void setClob(int index, Clob value) throws SQLException
This method sets the specified parameter from the given JavaClob
value. The default object type to SQL type mapping will be used.
- Parameters:
index
- The index of the parameter value to set.value
- TheClob
used to set the value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setDate(int index, Date value) throws SQLException
This method sets the specified parameter from the given Javajava.sql.Date
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setDate(int index, Date value, Calendar cal) throws SQLException
This method sets the specified parameter from the given Javajava.sql.Date
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.cal
- TheCalendar
to use for timezone and locale.
- Throws:
SQLException
- If an error occurs.
public void setDouble(int index, double value) throws SQLException
This method sets the specified parameter from the given Javadouble
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setFloat(int index, float value) throws SQLException
This method sets the specified parameter from the given Javafloat
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setInt(int index, int value) throws SQLException
This method sets the specified parameter from the given Javaint
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setLong(int index, long value) throws SQLException
This method sets the specified parameter from the given Javalong
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setNull(int index, int sqlType) throws SQLException
This method populates the specified parameter with a SQL NULL value for the specified type.
- Parameters:
index
- The index of the parameter to set.sqlType
- The SQL type identifier of the parameter fromTypes
- Throws:
SQLException
- If an error occurs.
public void setNull(int index, int sqlType, String typeName) throws SQLException
This method populates the specified parameter with a SQL NULL value for the specified type.
- Parameters:
index
- The index of the parameter to set.sqlType
- The SQL type identifier of the parameter fromTypes
typeName
- The name of the data type, for user defined types.
- Throws:
SQLException
- If an error occurs.
public void setObject(int index, Object value) throws SQLException
This method sets the specified parameter from the given JavaObject
value. The default object type to SQL type mapping will be used.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setObject(int index, Object value, int sqlType) throws SQLException
This method sets the specified parameter from the given JavaObject
value. The specified SQL object type will be used.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.sqlType
- The SQL type to use for the parameter, fromTypes
- Throws:
SQLException
- If an error occurs.
- See Also:
Types
public void setObject(int index, Object value, int sqlType, int scale) throws SQLException
This method sets the specified parameter from the given JavaObject
value. The specified SQL object type will be used.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.sqlType
- The SQL type to use for the parameter, fromTypes
scale
- The scale of the value, for numeric values only.
- Throws:
SQLException
- If an error occurs.
- See Also:
Types
public void setRef(int index, Ref value) throws SQLException
This method sets the specified parameter from the given JavaRef
value. The default object type to SQL type mapping will be used.
- Parameters:
index
- The index of the parameter value to set.value
- TheRef
used to set the value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setShort(int index, short value) throws SQLException
This method sets the specified parameter from the given Javashort
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setString(int index, String value) throws SQLException
This method sets the specified parameter from the given JavaString
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setTime(int index, Time value) throws SQLException
This method sets the specified parameter from the given Javajava.sql.Time
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setTime(int index, Time value, Calendar cal) throws SQLException
This method sets the specified parameter from the given Javajava.sql.Time
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.cal
- TheCalendar
to use for timezone and locale.
- Throws:
SQLException
- If an error occurs.
public void setTimestamp(int index, Timestamp value) throws SQLException
This method sets the specified parameter from the given Javajava.sql.Timestamp
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
public void setTimestamp(int index, Timestamp value, Calendar cal) throws SQLException
This method sets the specified parameter from the given Javajava.sql.Timestamp
value.
- Parameters:
index
- The index of the parameter value to set.value
- The value of the parameter.cal
- TheCalendar
to use for timezone and locale.
- Throws:
SQLException
- If an error occurs.
public void setURL(int index, URL value) throws SQLException
This method sets the specified parameter from the given Javajava.net.URL
value.
- Parameters:
index
- The index of the parameter to set.value
- The value of the parameter.
- Throws:
SQLException
- If an error occurs.
- Since:
- 1.4
public void setUnicodeStream(int index, InputStream stream, int count) throws SQLException
Deprecated.
This method sets the specified parameter from the given Java Unicode UTF-8InputStream
value.
- Parameters:
index
- The index of the parameter value to set.stream
- The stream from which the parameter value is read.count
- The number of bytes in the stream.
- Throws:
SQLException
- If an error occurs.