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 Type
    Method
    Description
    execute(Connection connection)
    Executes the SQL operation using the given JDBC connection.
    default R
    execute(DataSource dataSource)
    Executes the SQL operation using the given JDBC DataSource.
  • Method Details

    • execute

      R execute(Connection connection) throws SQLException
      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

      default R execute(DataSource dataSource) throws SQLException
      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