Package org.mariadb.jdbc
Class MariaDbPoolConnection
java.lang.Object
org.mariadb.jdbc.MariaDbPoolConnection
- All Implemented Interfaces:
PooledConnection
,XAConnection
- Direct Known Subclasses:
MariaDbInnerPoolConnection
MariaDB pool connection implementation
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Connection
private final List
<ConnectionEventListener> private final List
<StatementEventListener> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
close()
Close underlying connectionvoid
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.void
void
static String
xidToString
(Xid xid) Create XID string
-
Field Details
-
connection
-
connectionEventListeners
-
statementEventListeners
-
-
Constructor Details
-
MariaDbPoolConnection
Constructor.- Parameters:
connection
- connection to retrieve connection options
-
-
Method Details
-
xidToString
Create XID string- Parameters:
xid
- xid value- Returns:
- XID string
-
getConnection
- Specified by:
getConnection
in interfacePooledConnection
-
addConnectionEventListener
- Specified by:
addConnectionEventListener
in interfacePooledConnection
-
removeConnectionEventListener
- Specified by:
removeConnectionEventListener
in interfacePooledConnection
-
addStatementEventListener
- Specified by:
addStatementEventListener
in interfacePooledConnection
-
removeStatementEventListener
- Specified by:
removeStatementEventListener
in interfacePooledConnection
-
fireStatementClosed
Fire statement close event to registered listeners.- Parameters:
statement
- closing statement
-
fireStatementErrorOccurred
Fire statement error event to registered listeners.- Parameters:
statement
- closing statementreturnEx
- exception
-
fireConnectionClosed
Fire connection close event to registered listeners.- Parameters:
event
- close connection event
-
fireConnectionErrorOccurred
Fire connection error event to registered listeners.- Parameters:
returnEx
- exception
-
close
Close underlying connection- Specified by:
close
in interfacePooledConnection
- Throws:
SQLException
- if close fails
-
getXAResource
- Specified by:
getXAResource
in interfaceXAConnection
-