Interface Database.ConnectionOperation<T>
- Type Parameters:
T- The type of result produced by the operation executed within the database connection
- Enclosing class:
Database
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface representing a database operation that executes a specific task
using a provided
Connection object. This operation is designed to encapsulate
reusable database logic and handle SQL-related exceptions within a connection context.-
Method Summary
Modifier and TypeMethodDescriptionexecute(Connection connection) Executes a database operation using the providedConnectionand returns the result of typeT.
-
Method Details
-
execute
Executes a database operation using the providedConnectionand returns the result of typeT. This method encapsulates the logic for performing a specific task within the scope of the database connection.- Parameters:
connection- TheConnectionobject to be used for executing the operation. Must not be null.- Returns:
- An object of type
T, representing the result of the executed database operation. - Throws:
SQLException- If a database access error occurs or the operation fails.
-