| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface PreparedStatementextends StatementFields 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(seeParameterMetaDatafor 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 JavaArrayvalue. 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 ASCIIInputStreamvalue.
- 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.BigDecimalvalue.
- 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 binaryInputStreamvalue.
- 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 JavaBlobvalue. The default object type to SQL type mapping will be used.
- Parameters:
index- The index of the parameter value to set.value- TheBlobused 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 Javabooleanvalue.
- 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 Javabytevalue.
- 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 Javabytearray 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 characterReadervalue.
- 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 JavaClobvalue. The default object type to SQL type mapping will be used.
- Parameters:
index- The index of the parameter value to set.value- TheClobused 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.Datevalue.
- 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.Datevalue.
- Parameters:
index- The index of the parameter value to set.value- The value of the parameter.cal- TheCalendarto 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 Javadoublevalue.
- 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 Javafloatvalue.
- 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 Javaintvalue.
- 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 Javalongvalue.
- 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 fromTypestypeName- 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 JavaObjectvalue. 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 JavaObjectvalue. 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 JavaObjectvalue. 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, fromTypesscale- 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 JavaRefvalue. The default object type to SQL type mapping will be used.
- Parameters:
index- The index of the parameter value to set.value- TheRefused 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 Javashortvalue.
- 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 JavaStringvalue.
- 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.Timevalue.
- 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.Timevalue.
- Parameters:
index- The index of the parameter value to set.value- The value of the parameter.cal- TheCalendarto 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.Timestampvalue.
- 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.Timestampvalue.
- Parameters:
index- The index of the parameter value to set.value- The value of the parameter.cal- TheCalendarto 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.URLvalue.
- 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-8InputStreamvalue.
- 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.