Class ConnectionSet

java.lang.Object
ru.bitel.common.sql.ConnectionSet
All Implemented Interfaces:
AutoCloseable, ru.bitel.common.worker.Commitable

public abstract class ConnectionSet extends Object implements ru.bitel.common.worker.Commitable, AutoCloseable
Класс с коннекшнами к базе. Держать их по отдельности не всегда удобно.
  • Field Details

  • Constructor Details

    • ConnectionSet

      public ConnectionSet(Connection master, boolean autoCommit)
  • Method Details

    • getConnection

      public Connection getConnection()
    • newMasterConnection

      protected abstract Connection newMasterConnection()
    • newSlaveConnection

      protected abstract Connection newSlaveConnection()
    • newTrashConnection

      protected abstract Connection newTrashConnection(String tableName)
    • getSlaveConnection

      public Connection getSlaveConnection()
    • getTrashConnection

      public Connection getTrashConnection(String tableName, int defaultType)
    • commit

      public void commit() throws ru.bitel.bgbilling.common.BGException
      Specified by:
      commit in interface ru.bitel.common.worker.Commitable
      Throws:
      ru.bitel.bgbilling.common.BGException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getAutoCommit

      public boolean getAutoCommit()
    • setAutoCommit

      public void setAutoCommit(boolean autoCommit)
    • rollback

      public void rollback()
    • newInstance

      public static final ConnectionSet newInstance(DefaultServerSetup setup, boolean autoCommit)
    • newInstance

      public static final ConnectionSet newInstance(DefaultServerSetup setup, Connection con, boolean autoCommit)