Class MariaDbPoolConnection

  • All Implemented Interfaces:
    javax.sql.PooledConnection, javax.sql.XAConnection
    Direct Known Subclasses:
    MariaDbInnerPoolConnection, MariaDbPoolPinnedConnection

    public class MariaDbPoolConnection
    extends java.lang.Object
    implements javax.sql.PooledConnection, javax.sql.XAConnection
    MariaDB pool connection implementation
    • Field Detail

      • connectionEventListeners

        private final java.util.List<javax.sql.ConnectionEventListener> connectionEventListeners
      • statementEventListeners

        private final java.util.List<javax.sql.StatementEventListener> statementEventListeners
    • Constructor Detail

      • MariaDbPoolConnection

        public MariaDbPoolConnection​(Connection connection)
        Constructor.
        Parameters:
        connection - connection to retrieve connection options
    • Method Detail

      • xidToString

        public static java.lang.String xidToString​(javax.transaction.xa.Xid xid)
        Create XID string
        Parameters:
        xid - xid value
        Returns:
        XID string
      • getConnection

        public Connection getConnection()
        Specified by:
        getConnection in interface javax.sql.PooledConnection
      • addConnectionEventListener

        public void addConnectionEventListener​(javax.sql.ConnectionEventListener listener)
        Specified by:
        addConnectionEventListener in interface javax.sql.PooledConnection
      • removeConnectionEventListener

        public void removeConnectionEventListener​(javax.sql.ConnectionEventListener listener)
        Specified by:
        removeConnectionEventListener in interface javax.sql.PooledConnection
      • addStatementEventListener

        public void addStatementEventListener​(javax.sql.StatementEventListener listener)
        Specified by:
        addStatementEventListener in interface javax.sql.PooledConnection
      • removeStatementEventListener

        public void removeStatementEventListener​(javax.sql.StatementEventListener listener)
        Specified by:
        removeStatementEventListener in interface javax.sql.PooledConnection
      • fireStatementClosed

        public void fireStatementClosed​(java.sql.PreparedStatement statement)
        Fire statement close event to registered listeners.
        Parameters:
        statement - closing statement
      • fireStatementErrorOccurred

        public void fireStatementErrorOccurred​(java.sql.PreparedStatement statement,
                                               java.sql.SQLException returnEx)
        Fire statement error event to registered listeners.
        Parameters:
        statement - closing statement
        returnEx - exception
      • fireConnectionClosed

        public void fireConnectionClosed​(javax.sql.ConnectionEvent event)
        Fire connection close event to registered listeners.
        Parameters:
        event - close connection event
      • fireConnectionErrorOccurred

        public void fireConnectionErrorOccurred​(java.sql.SQLException returnEx)
        Fire connection error event to registered listeners.
        Parameters:
        returnEx - exception
      • close

        public void close()
                   throws java.sql.SQLException
        Close underlying connection
        Specified by:
        close in interface javax.sql.PooledConnection
        Throws:
        java.sql.SQLException - if close fails
      • realClose

        protected void realClose()
                          throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getXAResource

        public javax.transaction.xa.XAResource getXAResource()
        Specified by:
        getXAResource in interface javax.sql.XAConnection
      • mapXaException

        protected static javax.transaction.xa.XAException mapXaException​(java.sql.SQLException sqle)
      • flagsToString

        protected static java.lang.String flagsToString​(int flags)