prepareStatement
public PreparedStatement prepareStatement(String sql)
                                   throws SQLException
Creates a PreparedStatement object for sending parameterized SQL statements to the database. 
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times. Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement object is executed. This has no direct effect on users; however, it does affect which methods throw certain SQLException objects. Result sets created using the returned PreparedStatement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY. 
Parameters:
sql - an SQL statement that may contain one or more '?' IN parameter placeholders 
Returns:
a new default PreparedStatement object containing the pre-compiled SQL statement 
Throws: 
SQLException - if a database access error occurs
prepareStatement
public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency)
                                   throws SQLException
Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareStatement method above, but it allows the default result set type and concurrency to be overridden. Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain one or more ? IN parameters
resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE 
Returns:
a new PreparedStatement object containing the pre-compiled SQL statement that will produce ResultSet objects with the given type and concurrency 
Throws: 
SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type and concurrency
Since: 
1.2