Interface JdbcOperations

  • All Known Implementing Classes:
    FluentJdbc

    public interface JdbcOperations
    A high level API for performing SQL operations using JDBC.

    The design of this interface was heavily influenced by the FluentJdbc abstraction in the Spring Framework, however it differs significantly, particularly in the manner in which queries and updates are invoked. Nonetheless, users of FluentJdbc should find it familiar enough to easily learn.

    Author:
    Carl Harris
    • Method Detail

      • execute

        void execute​(String sql)
        Executes a single SQL (DDL) statement.
        Parameters:
        sql - the SQL statement to execute
      • execute

        void execute​(SQLSource source)
        Executes a single SQL (DDL) statement.
        Parameters:
        source - source for the SQL statement to execute
      • executeScript

        void executeScript​(SQLSource source)
        Executes the sequence of SQL statements produced by the given source.
        Parameters:
        source - source of the SQL statements to execute
      • query

        JdbcQuery<Void> query()
        Creates a query operation.

        This is a synonym for queryForType(Class) with Void as the specified type. A query obtained via this method is typically configured to use a ResultSetHandler to process returned rows.

        Returns:
        query object that can be configured and executed to retrieve rows from the database
      • queryForType

        <T> JdbcQuery<T> queryForType​(Class<T> type)
        Creates a query operation for objects of a given type.
        Parameters:
        type - subject type of the query
        Returns:
        a query that can be configured and executed to retreive rows from the database and return objects of type T.
      • update

        JdbcUpdate update()
        Creates an update operation.
        Returns:
        an updater that can be configured and executed to update rows in the database.
      • call

        JdbcCall call​(String sql)
        Creates a call operation.
        Parameters:
        sql - SQL call statement
        Returns:
        call operation
      • call

        JdbcCall call​(SQLSource source)
        Creates a call operation.
        Parameters:
        source - source for the SQL call statement
        Returns:
        call operation;