Package com.mckoi.database
Class InternalJDBCHelper.InternalConnection
- java.lang.Object
-
- com.mckoi.database.jdbc.MConnection
-
- com.mckoi.database.InternalJDBCHelper.InternalConnection
-
- All Implemented Interfaces:
DatabaseCallBack,java.lang.AutoCloseable,java.sql.Connection,java.sql.Wrapper
- Enclosing class:
- InternalJDBCHelper
private static class InternalJDBCHelper.InternalConnection extends MConnection
A derived java.sql.Connection class from MConnection. This class disables auto commit, and inherits case insensitivity from the parent DatabaseConnection.The decision to disable auto-commit was because this connection will typically be used as a sub-process for executing a complete command. Disabling auto-commit makes handling an internal connection more user friendly. Also, toggling this flag in the DatabaseConnection in mid- command is probably a very bad idea.
-
-
Field Summary
Fields Modifier and Type Field Description private InternalJDBCHelper.InternalDatabaseInterfaceinternal_db_interfaceThe DatabaseInterface for this connection.
-
Constructor Summary
Constructors Constructor Description InternalConnection(DatabaseConnection db, InternalJDBCHelper.InternalDatabaseInterface jdbc_interface, int cache_size, int max_size)Constructs the internal java.sql.Connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Overwritten from MConnection - closing an internal connection is a no-op.booleangetAutoCommit()Overwritten from MConnection - auto-commit is disabled and can not be enabled.(package private) InternalJDBCHelper.InternalDatabaseInterfacegetDBInterface()Returns the InternalDatabaseInterface that is used in this connection.voidsetAutoCommit(boolean status)Overwritten from MConnection - auto-commit is disabled and can not be enabled.-
Methods inherited from class com.mckoi.database.jdbc.MConnection
abort, addSQLWarning, clearWarnings, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, databaseEvent, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getRowCache, getSchema, getTransactionIsolation, getTypeMap, getWarnings, internalClose, isCaseInsensitiveIdentifiers, isClosed, isReadOnly, isStrictGetObject, isValid, isWrapperFor, login, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setCaseInsensitiveIdentifiers, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setStrictGetObject, setTransactionIsolation, setTypeMap, setVerboseColumnNames, unwrap, verboseColumnNames
-
-
-
-
Field Detail
-
internal_db_interface
private InternalJDBCHelper.InternalDatabaseInterface internal_db_interface
The DatabaseInterface for this connection.
-
-
Constructor Detail
-
InternalConnection
public InternalConnection(DatabaseConnection db, InternalJDBCHelper.InternalDatabaseInterface jdbc_interface, int cache_size, int max_size)
Constructs the internal java.sql.Connection.
-
-
Method Detail
-
getDBInterface
InternalJDBCHelper.InternalDatabaseInterface getDBInterface()
Returns the InternalDatabaseInterface that is used in this connection.
-
setAutoCommit
public void setAutoCommit(boolean status) throws java.sql.SQLExceptionOverwritten from MConnection - auto-commit is disabled and can not be enabled.- Specified by:
setAutoCommitin interfacejava.sql.Connection- Overrides:
setAutoCommitin classMConnection- Throws:
java.sql.SQLException
-
getAutoCommit
public boolean getAutoCommit() throws java.sql.SQLExceptionOverwritten from MConnection - auto-commit is disabled and can not be enabled.- Specified by:
getAutoCommitin interfacejava.sql.Connection- Overrides:
getAutoCommitin classMConnection- Throws:
java.sql.SQLException
-
close
public void close()
Overwritten from MConnection - closing an internal connection is a no-op. An InternalConnection should only close when the underlying transaction closes.To dispose an InternalConnection, use the static 'disposeJDBCConnection' method.
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.sql.Connection- Overrides:
closein classMConnection
-
-