org.springframework.jdbc.core

Class ArgumentTypePreparedStatementSetter

  • java.lang.Object
    • org.springframework.jdbc.core.ArgumentTypePreparedStatementSetter
    • Constructor Summary

      Constructors 
      Constructor and Description
      ArgumentTypePreparedStatementSetter(java.lang.Object[] args, int[] argTypes)
      Create a new ArgTypePreparedStatementSetter for the given arguments.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void cleanupParameters()
      Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like a SqlLobValue).
      protected void doSetValue(java.sql.PreparedStatement ps, int parameterPosition, int argType, java.lang.Object argValue)
      Set the value for the prepared statement's specified parameter position using the passed in value and type.
      void setValues(java.sql.PreparedStatement ps)
      Set parameter values on the given PreparedStatement.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArgumentTypePreparedStatementSetter

        public ArgumentTypePreparedStatementSetter(@Nullable
                                                   java.lang.Object[] args,
                                                   @Nullable
                                                   int[] argTypes)
        Create a new ArgTypePreparedStatementSetter for the given arguments.
        Parameters:
        args - the arguments to set
        argTypes - the corresponding SQL types of the arguments
    • Method Detail

      • setValues

        public void setValues(java.sql.PreparedStatement ps)
                       throws java.sql.SQLException
        Description copied from interface: PreparedStatementSetter
        Set parameter values on the given PreparedStatement.
        Specified by:
        setValues in interface PreparedStatementSetter
        Parameters:
        ps - the PreparedStatement to invoke setter methods on
        Throws:
        java.sql.SQLException - if a SQLException is encountered (i.e. there is no need to catch SQLException)
      • doSetValue

        protected void doSetValue(java.sql.PreparedStatement ps,
                                  int parameterPosition,
                                  int argType,
                                  java.lang.Object argValue)
                           throws java.sql.SQLException
        Set the value for the prepared statement's specified parameter position using the passed in value and type. This method can be overridden by sub-classes if needed.
        Parameters:
        ps - the PreparedStatement
        parameterPosition - index of the parameter position
        argType - the argument type
        argValue - the argument value
        Throws:
        java.sql.SQLException - if thrown by PreparedStatement methods