Package ru.bitel.common.sql
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 Summary
Modifier and TypeFieldDescriptionprotected boolean
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
commit()
protected void
finalize()
boolean
getTrashConnection
(String tableName, int defaultType) static final ConnectionSet
newInstance
(DefaultServerSetup setup, boolean autoCommit) static final ConnectionSet
newInstance
(DefaultServerSetup setup, Connection con, boolean autoCommit) protected abstract Connection
protected abstract Connection
protected abstract Connection
newTrashConnection
(String tableName) void
recycle()
void
rollback()
void
setAutoCommit
(boolean autoCommit)
-
Field Details
-
TYPE_MASTER
public static final int TYPE_MASTER- See Also:
-
TYPE_SLAVE
public static final int TYPE_SLAVE- See Also:
-
TYPE_TRASH
public static final int TYPE_TRASH- See Also:
-
TYPE_FAKE
public static final int TYPE_FAKE- See Also:
-
autoCommit
protected boolean autoCommit
-
-
Constructor Details
-
ConnectionSet
-
-
Method Details
-
getConnection
-
newMasterConnection
-
newSlaveConnection
-
newTrashConnection
-
getSlaveConnection
-
getTrashConnection
-
commit
public void commit() throws ru.bitel.bgbilling.common.BGException- Specified by:
commit
in interfaceru.bitel.common.worker.Commitable
- Throws:
ru.bitel.bgbilling.common.BGException
-
recycle
public void recycle()- Specified by:
recycle
in interfaceru.bitel.common.worker.Recyclable
-
getAutoCommit
public boolean getAutoCommit() -
setAutoCommit
public void setAutoCommit(boolean autoCommit) -
rollback
public void rollback() -
finalize
-
newInstance
-
newInstance
public static final ConnectionSet newInstance(DefaultServerSetup setup, Connection con, boolean autoCommit) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-