@FunctionalInterface public interface PreparedStatementCreator
Database
class.
Implementations create a PreparedStatement with a given active Connection, provided by the Database class. Still, they are responsible for providing the SQL statement and any necessary parameters.
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 |
---|---|
@NotNull PreparedStatement |
create(@NotNull Connection connection)
Creates a PreparedStatement in this connection.
|
@NotNull @NotNull PreparedStatement create(@NotNull @NotNull Connection connection) throws SQLException
connection
- the connection for creating the PreparedStatementSQLException
- if something goes wrong during the PreparedStatement creation (no need to catch)Copyright © 2021. All rights reserved.