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.InternalDatabaseInterface
internal_db_interface
The 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 void
close()
Overwritten from MConnection - closing an internal connection is a no-op.boolean
getAutoCommit()
Overwritten from MConnection - auto-commit is disabled and can not be enabled.(package private) InternalJDBCHelper.InternalDatabaseInterface
getDBInterface()
Returns the InternalDatabaseInterface that is used in this connection.void
setAutoCommit(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.SQLException
Overwritten from MConnection - auto-commit is disabled and can not be enabled.- Specified by:
setAutoCommit
in interfacejava.sql.Connection
- Overrides:
setAutoCommit
in classMConnection
- Throws:
java.sql.SQLException
-
getAutoCommit
public boolean getAutoCommit() throws java.sql.SQLException
Overwritten from MConnection - auto-commit is disabled and can not be enabled.- Specified by:
getAutoCommit
in interfacejava.sql.Connection
- Overrides:
getAutoCommit
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.sql.Connection
- Overrides:
close
in classMConnection
-
-