T
- yhe argument type@FunctionalInterface public interface ParametrizedBatchSetter<T>
Database
class for executing batch updates.
Implementations of this interface set values on a PreparedStatement
provided by the Database 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 internally by DataOperations
implementations.
If the handling is done in async context then implementations should make the details available in some way.
AsyncDataOperations
may place these details inside a never null CompletableFuture object.
Modifier and Type | Method and Description |
---|---|
void |
setValues(@NotNull PreparedStatement preparedStatement,
T argument)
Sets the parameter values of the T argument inside the PreparedStatement
|
void setValues(@NotNull @NotNull PreparedStatement preparedStatement, T argument) throws SQLException
preparedStatement
- an active PreparedStatementargument
- a generic object containing the values to setSQLException
- if an SQLException is encountered while trying to set values (no need to catch)Copyright © 2021. All rights reserved.