Interface Sql<R>
- Type Parameters:
R- the type of result returned by the SQL operation
- All Known Implementing Classes:
SqlBuilder,SqlBuilder.CallableSqlBuilder,SqlBuilder.CallableSqlBuilder.CallableSqlBuilderWrapper,SqlBuilder.PreparedSqlBuilder,Transaction
public interface Sql<R>
Represents a generic SQL operation that can be executed using a JDBC
Connection or DataSource. This interface allows you to define SQL
operations that return a result of type R.
-
Method Summary
Modifier and TypeMethodDescriptionexecute(Connection connection) Executes the SQL operation using the given JDBC connection.default Rexecute(DataSource dataSource) Executes the SQL operation using the given JDBC DataSource.
-
Method Details
-
execute
Executes the SQL operation using the given JDBC connection.- Parameters:
connection- JDBC connection to use for execution- Returns:
- result of the SQL operation
- Throws:
SQLException- if an error occurs during execution
-
execute
Executes the SQL operation using the given JDBC DataSource.- Parameters:
dataSource- JDBC DataSource to use for execution- Returns:
- result of the SQL operation
- Throws:
SQLException- if an error occurs during execution
-