Interface StatementCallback


public interface StatementCallback
Generic callback interface for code that operates on a JDBC Statement. Allows to execute any number of operations on a single Statement, for example a single executeUpdate call or repeated executeUpdate calls with varying SQL.

Used internally by JdbcTemplate, but also useful for application code.

  • Method Details

    • doInStatement

      Object doInStatement(Statement stmt) throws SQLException, DatabaseException
      Gets called by JdbcTemplate.execute with an active JDBC Statement. Does not need to care about closing the Statement or the Connection, or about handling transactions: this will all be handled by JdbcTemplate.

      Parameters:
      stmt - active JDBC Statement
      Returns:
      a result object, or null if none
      Throws:
      SQLException
      DatabaseException
    • getStatement

      SqlStatement getStatement()