Package org.springframework.jdbc.core
Class CallableStatementCreatorFactory
java.lang.Object
org.springframework.jdbc.core.CallableStatementCreatorFactory
Helper class that efficiently creates multiple
CallableStatementCreator
objects with different parameters based on an SQL statement and a single
set of parameter declarations.- Author:
- Rod Johnson, Thomas Risberg, Juergen Hoeller
-
Constructor Summary
ConstructorDescriptionCallableStatementCreatorFactory
(String callString) Create a new factory.CallableStatementCreatorFactory
(String callString, List<SqlParameter> declaredParameters) Create a new factory with the given SQL and the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(SqlParameter param) Add a new declared parameter.final String
Return the SQL call string.newCallableStatementCreator
(Map<String, ?> params) Return a new CallableStatementCreator instance given these parameters.newCallableStatementCreator
(ParameterMapper inParamMapper) Return a new CallableStatementCreator instance given this parameter mapper.void
setResultSetType
(int resultSetType) Set whether to use prepared statements that return a specific type of ResultSet.void
setUpdatableResults
(boolean updatableResults) Set whether to use prepared statements capable of returning updatable ResultSets.
-
Constructor Details
-
CallableStatementCreatorFactory
Create a new factory. Will need to add parameters via theaddParameter(org.springframework.jdbc.core.SqlParameter)
method or have no parameters.- Parameters:
callString
- the SQL call string
-
CallableStatementCreatorFactory
Create a new factory with the given SQL and the given parameters.- Parameters:
callString
- the SQL call stringdeclaredParameters
- list ofSqlParameter
objects
-
-
Method Details
-
getCallString
Return the SQL call string.- Since:
- 5.1.3
-
addParameter
Add a new declared parameter.Order of parameter addition is significant.
- Parameters:
param
- the parameter to add to the list of declared parameters
-
setResultSetType
public void setResultSetType(int resultSetType) Set whether to use prepared statements that return a specific type of ResultSet. specific type of ResultSet.- Parameters:
resultSetType
- the ResultSet type- See Also:
-
setUpdatableResults
public void setUpdatableResults(boolean updatableResults) Set whether to use prepared statements capable of returning updatable ResultSets. -
newCallableStatementCreator
Return a new CallableStatementCreator instance given these parameters.- Parameters:
params
- list of parameters (may benull
)
-
newCallableStatementCreator
Return a new CallableStatementCreator instance given this parameter mapper.- Parameters:
inParamMapper
- the ParameterMapper implementation that will return a Map of parameters
-