类 StatementCreatorUtils

    • 方法详细资料

      • setParameterValue

        public static void setParameterValue​(PreparedStatement ps,
                                             int paramIndex,
                                             SqlParameter param,
                                             Object inValue)
                                      throws SQLException
        Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.
        参数:
        ps - the prepared statement or callable statement
        paramIndex - index of the parameter we are setting
        param - the parameter as it is declared including type
        inValue - the value to set
        抛出:
        SQLException - if thrown by PreparedStatement methods
      • setParameterValue

        public static void setParameterValue​(PreparedStatement ps,
                                             int paramIndex,
                                             int sqlType,
                                             Object inValue)
                                      throws SQLException
        Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.
        参数:
        ps - the prepared statement or callable statement
        paramIndex - index of the parameter we are setting
        sqlType - the SQL type of the parameter
        inValue - the value to set (plain value or a SqlTypeValue)
        抛出:
        SQLException - if thrown by PreparedStatement methods
        另请参阅:
        SqlTypeValue
      • setParameterValue

        public static void setParameterValue​(PreparedStatement ps,
                                             int paramIndex,
                                             int sqlType,
                                             String typeName,
                                             Object inValue)
                                      throws SQLException
        Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.
        参数:
        ps - the prepared statement or callable statement
        paramIndex - index of the parameter we are setting
        sqlType - the SQL type of the parameter
        typeName - the type name of the parameter (optional, only used for SQL NULL and SqlTypeValue)
        inValue - the value to set (plain value or a SqlTypeValue)
        抛出:
        SQLException - if thrown by PreparedStatement methods
        另请参阅:
        SqlTypeValue