Interface DBInterface

All Known Subinterfaces:
ConfigurationInterface
All Known Implementing Classes:
AbstractDBInterface, PersistenceSession.PersistenceSessionDBInterface

public interface DBInterface
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A transaction represents a sequence of commands that need to be executed as a group, or not at all.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    long
    getSeq(String seqName)
    Gets the next value in a named integer sequence.
    long
    getSeq(String seqName, Connection connection)
    Like the other getSeq, but operates against a particular local db connection, which may be necessary if the sequence generation is part of a transaction.
    runPrepQuery(String query, Object... args)
    Runs the given SELECT query as a prepared statement, after setting the arguments in the varargs list.
    int
    Runs the given UPDATE/INSERT/DELETE query as a prepared statement, after setting the arguments in the varargs list.
    Runs the given SELECT query, and returns the results in a List of Lists of Objects.
    Runs the given SELECT query, returns the value in the first row of the first column, as its natural type.
    Creates a connection, and runs the given transaction.
    int
    Runs the given UPDATE/INSERT/DELETE query, and returns the number of rows affected.
  • Method Details

    • getConnection

      Connection getConnection() throws SQLException
      Throws:
      SQLException
    • runScalarQuery

      @Nullable Object runScalarQuery(String query) throws SQLException
      Runs the given SELECT query, returns the value in the first row of the first column, as its natural type. If no rows are returned, null is returned.
      Throws:
      SQLException
    • runQuery

      List<List<Object>> runQuery(String query) throws SQLException
      Runs the given SELECT query, and returns the results in a List of Lists of Objects.
      Throws:
      SQLException
    • runPrepQuery

      List<List<Object>> runPrepQuery(String query, Object... args) throws SQLException
      Runs the given SELECT query as a prepared statement, after setting the arguments in the varargs list. Returns the results in a List of Lists of Objects.
      Throws:
      SQLException
    • runUpdateQuery

      int runUpdateQuery(String query) throws SQLException
      Runs the given UPDATE/INSERT/DELETE query, and returns the number of rows affected.
      Throws:
      SQLException
    • runPrepUpdate

      int runPrepUpdate(String query, Serializable... args) throws SQLException
      Runs the given UPDATE/INSERT/DELETE query as a prepared statement, after setting the arguments in the varargs list. Returns the number of rows affected.
      Throws:
      SQLException
    • getSeq

      long getSeq(String seqName) throws SQLException
      Gets the next value in a named integer sequence.
      Throws:
      SQLException
    • getSeq

      long getSeq(String seqName, Connection connection) throws SQLException
      Like the other getSeq, but operates against a particular local db connection, which may be necessary if the sequence generation is part of a transaction.
      Throws:
      SQLException
    • runTransaction

      Object runTransaction(DBInterface.Transaction tx) throws SQLException
      Creates a connection, and runs the given transaction. Transactions need to be serializable.
      Throws:
      SQLException