Class CoStoSysConnection
- java.lang.Object
-
- de.julielab.costosys.dbconnection.CoStoSysConnection
-
- All Implemented Interfaces:
AutoCloseable
public class CoStoSysConnection extends Object implements AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description CoStoSysConnection(DataBaseConnector dbc, Connection connection, boolean shared)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcommit()StatementcreateStatement()booleangetAutoCommit()ConnectiongetConnection()DatabaseMetaDatagetMetaData()intgetUsageNumber()booleanincrementUsageNumber()booleanisClosed()booleanisShared()Indicates if this connection can be shared between different code and threads.PreparedStatementprepareStatement(String sql)voidsetAutoCommit(boolean b)
-
-
-
Constructor Detail
-
CoStoSysConnection
public CoStoSysConnection(DataBaseConnector dbc, Connection connection, boolean shared)
-
-
Method Detail
-
isShared
public boolean isShared()
Indicates if this connection can be shared between different code and threads.
- Returns:
- True if this connection can be freely shared.
-
getUsageNumber
public int getUsageNumber()
-
incrementUsageNumber
public boolean incrementUsageNumber()
-
getConnection
public Connection getConnection()
-
isClosed
public boolean isClosed()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
createStatement
public Statement createStatement() throws SQLException
- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException
- Throws:
SQLException
-
commit
public void commit() throws SQLException- Throws:
SQLException
-
getMetaData
public DatabaseMetaData getMetaData() throws SQLException
- Throws:
SQLException
-
getAutoCommit
public boolean getAutoCommit() throws SQLException- Throws:
SQLException
-
setAutoCommit
public void setAutoCommit(boolean b) throws SQLException- Throws:
SQLException
-
-