Package org.mariadb.jdbc

# Class MariaDbPoolConnection

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

All Implemented Interfaces:
  `PooledConnection`, `XAConnection`

Direct Known Subclasses:
  `MariaDbPoolPinnedConnection`

public class MariaDbPoolConnection extends Object implements PooledConnection, XAConnection
MariaDB pool connection implementation

## Constructor Summary

Constructors
Constructor
Description
`MariaDbPoolConnection(Connection connection)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`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.
`protected static String`
`flagsToString(int flags)`
`Connection`
`getConnection()`
`XAResource`
`getXAResource()`
`protected static XAException`
`mapXaException(SQLException sqle)`
`protected void`
`realClose()`
`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 Details

### MariaDbPoolConnection

public MariaDbPoolConnection(Connection connection)
Constructor.

Parameters:
  `connection` - connection to retrieve connection options

## Method Details

### 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

### realClose

protected void realClose() throws SQLException

Throws:
  `SQLException`

### getXAResource

public XAResource getXAResource()

Specified by:
  `getXAResource` in interface `XAConnection`

### mapXaException

protected static XAException mapXaException(SQLException sqle)

### flagsToString

protected static String flagsToString(int flags)