Package org.mariadb.jdbc

## Class MariaDbPoolConnection

- java.lang.Object
- - org.mariadb.jdbc.MariaDbPoolConnection

All Implemented Interfaces:
  `PooledConnection`, `XAConnection`

    public class MariaDbPoolConnection
    extends Object
    implements PooledConnection, XAConnection

MariaDB pool connection implementation

### Constructor Summary

Constructors
`MariaDbPoolConnection​(Connection connection)` Constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addConnectionEventListener​(ConnectionEventListener listener)`
`void` `addStatementEventListener​(StatementEventListener listener)`
`void` `close()` Close underlying connection
`void` `fireConnectionClosed​(ConnectionEvent event)` Fire connection close event to registered listeners.
`void` `fireConnectionErrorOccurred​(SQLException returnEx)` Fire connection error event to registered listeners.
`void` `fireStatementClosed​(PreparedStatement statement)` Fire statement close event to registered listeners.
`void` `fireStatementErrorOccurred​(PreparedStatement statement, SQLException returnEx)` Fire statement error event to registered listeners.
`Connection` `getConnection()`
`XAResource` `getXAResource()`
`void` `removeConnectionEventListener​(ConnectionEventListener listener)`
`void` `removeStatementEventListener​(StatementEventListener listener)`
`static String` `xidToString​(Xid xid)` Create XID string

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MariaDbPoolConnection

    public MariaDbPoolConnection​(Connection connection)

Constructor.

Parameters:
  `connection` - connection to retrieve connection options

### Method Detail

#### xidToString

    public static String xidToString​(Xid xid)

Create XID string

Parameters:
  `xid` - xid value
Returns:
  XID string

#### getConnection

    public Connection getConnection()

Specified by:
  `getConnection` in interface `PooledConnection`

#### addConnectionEventListener

    public void addConnectionEventListener​(ConnectionEventListener listener)

Specified by:
  `addConnectionEventListener` in interface `PooledConnection`

#### removeConnectionEventListener

    public void removeConnectionEventListener​(ConnectionEventListener listener)

Specified by:
  `removeConnectionEventListener` in interface `PooledConnection`

#### addStatementEventListener

    public void addStatementEventListener​(StatementEventListener listener)

Specified by:
  `addStatementEventListener` in interface `PooledConnection`

#### removeStatementEventListener

    public void removeStatementEventListener​(StatementEventListener listener)

Specified by:
  `removeStatementEventListener` in interface `PooledConnection`

#### fireStatementClosed

    public void fireStatementClosed​(PreparedStatement statement)

Fire statement close event to registered listeners.

Parameters:
  `statement` - closing statement

#### fireStatementErrorOccurred

    public void fireStatementErrorOccurred​(PreparedStatement statement,
                                           SQLException returnEx)

Fire statement error event to registered listeners.

Parameters:
  `statement` - closing statement
  `returnEx` - exception

#### fireConnectionClosed

    public void fireConnectionClosed​(ConnectionEvent event)

Fire connection close event to registered listeners.

Parameters:
  `event` - close connection event

#### fireConnectionErrorOccurred

    public void fireConnectionErrorOccurred​(SQLException returnEx)

Fire connection error event to registered listeners.

Parameters:
  `returnEx` - exception

#### close

    public void close()
               throws SQLException

Close underlying connection

Specified by:
  `close` in interface `PooledConnection`
Throws:
  `SQLException` - if close fails

#### getXAResource

    public XAResource getXAResource()

Specified by:
  `getXAResource` in interface `XAConnection`