Interface ParametrizedPreparedStatementSetter<T>

  • Type Parameters:
    T - yhe argument type

    public interface ParametrizedPreparedStatementSetter<T>
    Represents a callback interface used by the DataTemplate class for executing batch updates.

    Implementations of this interface set values on a PreparedStatement provided by the DataTemplate class, for each of a number of updates in a batch using the same SQL statement. They are responsible for setting parameters: a SQL statement with placeholders (question marks) will already have been supplied.

    Implementations don't need to worry about handling exceptions: they will be handled by aSQL DataTemplate and passed to a CompletableFuture for further analysis by the user.

    See Also:
    DataTemplate.batchUpdate(String, List, ParametrizedPreparedStatementSetter)
    • Method Detail

      • setValues

        void setValues​(PreparedStatement ps,
                       T argument)
                throws SQLException
        Sets the parameter values of the T argument inside the PreparedStatement
        Parameters:
        ps - an active PreparedStatement
        argument - a generic object containing the values to set
        Throws:
        SQLException - if an SQLException is encountered while trying to set values (no need to catch)