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 Constructor Description MariaDbPoolConnection(Connection connection)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionEventListener(ConnectionEventListener listener)voidaddStatementEventListener(StatementEventListener listener)voidclose()Close underlying connectionvoidfireConnectionClosed(ConnectionEvent event)Fire connection close event to registered listeners.voidfireConnectionErrorOccurred(SQLException returnEx)Fire connection error event to registered listeners.voidfireStatementClosed(PreparedStatement statement)Fire statement close event to registered listeners.voidfireStatementErrorOccurred(PreparedStatement statement, SQLException returnEx)Fire statement error event to registered listeners.ConnectiongetConnection()XAResourcegetXAResource()voidremoveConnectionEventListener(ConnectionEventListener listener)voidremoveStatementEventListener(StatementEventListener listener)static StringxidToString(Xid xid)Create XID string
-
-
-
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:
getConnectionin interfacePooledConnection
-
addConnectionEventListener
public void addConnectionEventListener(ConnectionEventListener listener)
- Specified by:
addConnectionEventListenerin interfacePooledConnection
-
removeConnectionEventListener
public void removeConnectionEventListener(ConnectionEventListener listener)
- Specified by:
removeConnectionEventListenerin interfacePooledConnection
-
addStatementEventListener
public void addStatementEventListener(StatementEventListener listener)
- Specified by:
addStatementEventListenerin interfacePooledConnection
-
removeStatementEventListener
public void removeStatementEventListener(StatementEventListener listener)
- Specified by:
removeStatementEventListenerin interfacePooledConnection
-
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 statementreturnEx- 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 SQLExceptionClose underlying connection- Specified by:
closein interfacePooledConnection- Throws:
SQLException- if close fails
-
getXAResource
public XAResource getXAResource()
- Specified by:
getXAResourcein interfaceXAConnection
-
-