Breaking News
yeni film izle hd film seyret film izle

Methods of the PreparedStatement Interface In JDBC

Methods of the PreparedStatement Interface

The PreparedStatement interface creates an object that represents a precompiled SQL statement.
A SQL statement is pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times. Note: The setter methods for setting IN parameter values must specify types that are compatible with the defined SQL type of the input parameter. For instance, if the IN parameter has SQL type INTEGER, then the method setInt should be used.
java.sql package

public interface PreparedStatement

extends Statement

PreparedStatement interface methods
Method return value type Method
void clearParameters()
Clears the current parameter values immediately.
boolean execute()
Executes any kind of SQL statement.
ResultSet executeQuery() 
Executes the SQL query in this PreparedStatement object and returns the result set generated by the query.
int executeUpdate() 
Executes the SQL INSERT, UPDATE or DELETE statement in this PreparedStatement object.
void setBigDecimal (int parameterIndex, BigDecimal x) 
Sets the designated parameter to a java.lang.BigDecimal value.
void setBinaryStream(int parameterIndex, InputStream x, int length)
void setBoolean (int parameterIndex, boolean x) 
Sets the designated parameter to a Java boolean value. JDBC driver converts this to an SQL SMALLINT value when it sends it to the database.
void setBlob(int i, Blob x) JDBC 2.0 
Sets a BLOB parameter.
void setDate(int parameterIndex, Date x) 
Sets the designated parameter to a java.sql.Date value.
void setDouble(int parameterIndex, double x) 
Sets the designated parameter to a Java double value. JDBC driver converts this to an SQL DECIMAL value when it sends it to the database.
void setFloat(int parameterIndex, float x) 
Sets the designated parameter to a Java float value. When a BigDecimal is converted to float, if the BigDecimal is too large to represent as a float, it will be converted to FLOAT.NEGATIVE_INFINITY or FLOAT.POSITIVE_INFINITY as appropriate.
void setInt (int parameterIndex, int x) 
Sets the designated parameter to a Java int value.
void setLong(int parameterIndex, long x) 
Sets the designated parameter to a Java long value.
void setNull (int parameterIndex, int sqlType) 
Sets the designated parameter to SQL NULL.
void setObject(int parameterIndex, Object x, int targetSqlType) 
Sets the value of the designated parameter with the given object.
void setShort (int parameterIndex, short x) 
Sets the designated parameter to a Java short value.
void setString (int parameterIndex, String x) 
Sets the designated parameter to a Java String value.
void setTime (int parameterIndex, Time x) 
Sets the designated parameter to a java.sql.Time value.
void setTimestamp (int parameterIndex, Timestamp x) 
Sets the designated parameter to a java.sql.Timestamp value
void setTimestamp (int parameterIndex, Timestamp x) 
Sets the designated parameter to a java.sql.Timestamp value