Interface DbInterface

All Known Implementing Classes:
DbState

public interface DbInterface
Represents a connection to a (real or simulated) database.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Commit a pending transaction.
    void
    Connect to the database.
    void
    Create an index.
    void
    createTable(org.h2.test.synth.sql.Table table)
    Create the specified table.
    org.h2.test.synth.sql.Result
    delete(org.h2.test.synth.sql.Table table, String condition)
    Delete a number of rows.
    void
    Disconnect from the database.
    void
    Drop an index.
    void
    dropTable(org.h2.test.synth.sql.Table table)
    Drop the specified table.
    void
    end()
    Close the connection and the database.
    org.h2.test.synth.sql.Result
    insert(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] c, Value[] v)
    Insert a row into a table.
    void
    Drop all objects in the database.
    void
    Roll back a pending transaction.
    org.h2.test.synth.sql.Result
    Execute a query.
    void
    setAutoCommit(boolean b)
    Enable or disable autocommit.
    org.h2.test.synth.sql.Result
    update(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] columns, Value[] values, String condition)
    Update the given table with the new values.
  • Method Details

    • reset

      void reset() throws SQLException
      Drop all objects in the database.
      Throws:
      SQLException
    • connect

      void connect() throws Exception
      Connect to the database.
      Throws:
      Exception
    • disconnect

      void disconnect() throws SQLException
      Disconnect from the database.
      Throws:
      SQLException
    • end

      void end() throws SQLException
      Close the connection and the database.
      Throws:
      SQLException
    • createTable

      void createTable(org.h2.test.synth.sql.Table table) throws SQLException
      Create the specified table.
      Parameters:
      table - the table to create
      Throws:
      SQLException
    • dropTable

      void dropTable(org.h2.test.synth.sql.Table table) throws SQLException
      Drop the specified table.
      Parameters:
      table - the table to drop
      Throws:
      SQLException
    • createIndex

      void createIndex(Index index) throws SQLException
      Create an index.
      Parameters:
      index - the index to create
      Throws:
      SQLException
    • dropIndex

      void dropIndex(Index index) throws SQLException
      Drop an index.
      Parameters:
      index - the index to drop
      Throws:
      SQLException
    • insert

      org.h2.test.synth.sql.Result insert(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] c, Value[] v) throws SQLException
      Insert a row into a table.
      Parameters:
      table - the table
      c - the column list
      v - the values
      Returns:
      the result
      Throws:
      SQLException
    • select

      org.h2.test.synth.sql.Result select(String sql) throws SQLException
      Execute a query.
      Parameters:
      sql - the SQL statement
      Returns:
      the result
      Throws:
      SQLException
    • delete

      org.h2.test.synth.sql.Result delete(org.h2.test.synth.sql.Table table, String condition) throws SQLException
      Delete a number of rows.
      Parameters:
      table - the table
      condition - the condition
      Returns:
      the result
      Throws:
      SQLException
    • update

      org.h2.test.synth.sql.Result update(org.h2.test.synth.sql.Table table, org.h2.test.synth.sql.Column[] columns, Value[] values, String condition) throws SQLException
      Update the given table with the new values.
      Parameters:
      table - the table
      columns - the columns to update
      values - the new values
      condition - the condition
      Returns:
      the result of the update
      Throws:
      SQLException
    • setAutoCommit

      void setAutoCommit(boolean b) throws SQLException
      Enable or disable autocommit.
      Parameters:
      b - the new value
      Throws:
      SQLException
    • commit

      void commit() throws SQLException
      Commit a pending transaction.
      Throws:
      SQLException
    • rollback

      void rollback() throws SQLException
      Roll back a pending transaction.
      Throws:
      SQLException