A prepared statement can be executed once concrete values have been provided for the bound variables. A prepared statement and the values for its bound variables constitute a BoundStatement and can be executed (by {@link Session#execute}).
A {@code PreparedStatement} object allows you to define specific defaultsfor the different properties of a {@link Statement} (Consistency level, tracing, ...),in which case those properties will be inherited as default by every BoundedStatement created from the {PreparedStatement}. The default for those {@code PreparedStatement} properties is the same that in {@link Statement} if thePreparedStatement is created by {@link Session#prepare(String)} but will inheritof the properties of the {@link RegularStatement} used for the preparation if{@link Session#prepare(RegularStatement)} is used.
Note: The setXXX 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 setInt should be used.
If arbitrary parameter type conversions are required, then the setObject method should be used with a target SQL type.
@author Mark Matthews @version $Id: PreparedStatement.java,v 1.1.2.1 2005/05/13 18:58:38 mmatthewsExp $ @see java.sql.ResultSet @see java.sql.PreparedStatementAn SQL Statement is put into a PreparedStatement and is precompiled so that it can be executed multiple times efficiently.
Setter methods are supplied in the PreparedStatement interface for the setting of IN parameters for the Statement. The setter method used for each IN parameter must match the type of the IN parameter being set.
|
|
|
|
|
|
|
|
|
|
|
|