public class PreparedStatementCreatorFactory (Code)
Helper class that efficiently creates multiple
PreparedStatementCreator objects with different parameters based on a SQL statement and a single
set of parameter declarations.
author: Rod Johnson author: Juergen Hoeller
setResultSetType(int resultSetType) Set whether to use prepared statements that return a
specific type of ResultSet.
public void
setReturnGeneratedKeys(boolean returnGeneratedKeys) Set whether prepared statements should be capable of returning
auto-generated keys.
public void
setUpdatableResults(boolean updatableResults) Set whether to use prepared statements capable of returning
updatable ResultSets.
Constructor Detail
PreparedStatementCreatorFactory
public PreparedStatementCreatorFactory(String sql)(Code)
Create a new factory. Will need to add parameters
via the addParameter() method or have no parameters.
PreparedStatementCreatorFactory
public PreparedStatementCreatorFactory(String sql, int[] types)(Code)
Create a new factory with the given SQL and JDBC types.
Parameters: sql - SQL to execute Parameters: types - int array of JDBC types
PreparedStatementCreatorFactory
public PreparedStatementCreatorFactory(String sql, List declaredParameters)(Code)
Create a new factory with the given SQL and parameters.
Parameters: sql - SQL Parameters: declaredParameters - list of SqlParameter objects See Also:SqlParameter
Return a new PreparedStatementCreator for the given parameters.
Parameters: sqlToUse - the actual SQL statement to use (if different fromthe factory's, for example because of named parameter expanding) Parameters: params - the parameter array (may be null)