Class 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.

    • Method Detail

      • 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 interface java.sql.Connection
        Overrides:
        setAutoCommit in class MConnection
        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 interface java.sql.Connection
        Overrides:
        getAutoCommit in class MConnection
        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 interface java.lang.AutoCloseable
        Specified by:
        close in interface java.sql.Connection
        Overrides:
        close in class MConnection