org.springframework.jdbc.core

Class CallableStatementCreatorFactory

  • java.lang.Object
    • org.springframework.jdbc.core.CallableStatementCreatorFactory


  • public class CallableStatementCreatorFactory
    extends java.lang.Object
    Helper class that efficiently creates multiple CallableStatementCreator objects with different parameters based on a SQL statement and a single set of parameter declarations.
    Author:
    Rod Johnson, Thomas Risberg, Juergen Hoeller
    • Constructor Detail

      • CallableStatementCreatorFactory

        public CallableStatementCreatorFactory(java.lang.String callString)
        Create a new factory. Will need to add parameters via the addParameter(org.springframework.jdbc.core.SqlParameter) method or have no parameters.
        Parameters:
        callString - the SQL call string
      • CallableStatementCreatorFactory

        public CallableStatementCreatorFactory(java.lang.String callString,
                                               java.util.List<SqlParameter> declaredParameters)
        Create a new factory with the given SQL and the given parameters.
        Parameters:
        callString - the SQL call string
        declaredParameters - list of SqlParameter objects
    • Method Detail

      • addParameter

        public void addParameter(SqlParameter param)
        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:
        ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE
      • setUpdatableResults

        public void setUpdatableResults(boolean updatableResults)
        Set whether to use prepared statements capable of returning updatable ResultSets.
      • newCallableStatementCreator

        public CallableStatementCreator newCallableStatementCreator(@Nullable
                                                                    java.util.Map<java.lang.String,?> params)
        Return a new CallableStatementCreator instance given this parameters.
        Parameters:
        params - list of parameters (may be null)
      • newCallableStatementCreator

        public CallableStatementCreator newCallableStatementCreator(ParameterMapper inParamMapper)
        Return a new CallableStatementCreator instance given this parameter mapper.
        Parameters:
        inParamMapper - the ParameterMapper implementation that will return a Map of parameters