Class ConnectionSet

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

public abstract class ConnectionSet extends Object implements ru.bitel.common.worker.Recyclable, 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
    • recycle

      public void recycle()
      Specified by:
      recycle in interface ru.bitel.common.worker.Recyclable
    • getAutoCommit

      public boolean getAutoCommit()
    • setAutoCommit

      public void setAutoCommit(boolean autoCommit)
    • rollback

      public void rollback()
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • newInstance

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

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

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