Package org.sql2o

Class Connection

All Implemented Interfaces:
Closeable, AutoCloseable

public class Connection extends Object implements AutoCloseable, Closeable
Represents a connection to the database with a transaction.
  • Method Details

    • isRollbackOnException

      public boolean isRollbackOnException()
    • setRollbackOnException

      public Connection setRollbackOnException(boolean rollbackOnException)
    • isRollbackOnClose

      public boolean isRollbackOnClose()
    • setRollbackOnClose

      public Connection setRollbackOnClose(boolean rollbackOnClose)
    • getJdbcConnection

      public Connection getJdbcConnection()
    • getSql2o

      public Sql2o getSql2o()
    • createQuery

      public Query createQuery(String queryText)
    • createQuery

      public Query createQuery(String queryText, boolean returnGeneratedKeys)
    • createQuery

      public Query createQuery(String queryText, String... columnNames)
    • createQueryWithParams

      public Query createQueryWithParams(String queryText, Object... paramValues)
    • rollback

      public Sql2o rollback()
    • rollback

      public Connection rollback(boolean closeConnection)
    • commit

      public Sql2o commit()
    • commit

      public Connection commit(boolean closeConnection)
    • getResult

      public int getResult()
    • getBatchResult

      public int[] getBatchResult()
    • getKey

      public Object getKey()
    • getKey

      public <V> V getKey(Class returnType)
    • getKeys

      public Object[] getKeys()
    • getKeys

      public <V> List<V> getKeys(Class<V> returnType)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable