@ComponentProfile(summary="Connect to a database using a JDBC driver; connection pooling is pluggable", tag="connections,jdbc", since="3.9.2") public class PluggableJdbcPooledConnection extends JdbcPooledConnectionImpl
JdbcPooledConnectionImpl
that allows you to plug in connection pool
implementations.
Generally, we find that c3p0 is good enough; however, in some use-cases you might want to switch to a different connection pool implementation. This variant allows you to plug in different builder implementations for the underlying connection pool.
connectionPool
log
Constructor and Description |
---|
PluggableJdbcPooledConnection() |
Modifier and Type | Method and Description |
---|---|
protected PooledDataSource |
createPool() |
boolean |
equals(java.lang.Object other)
Force implementations to over-ride equals with a semantic implementation.
|
ConnectionPoolBuilder |
getBuilder() |
KeyValuePairSet |
getPoolProperties() |
int |
hashCode()
Force implementations to over-ride hashcode.
|
KeyValuePairSet |
poolProperties() |
void |
setBuilder(ConnectionPoolBuilder builder)
Set the builder to use when creating the connection pool.
|
void |
setPoolProperties(KeyValuePairSet kvps)
Set any additional connection pool properties over and above the defaults.
|
PluggableJdbcPooledConnection |
withBuilder(ConnectionPoolBuilder builder) |
PluggableJdbcPooledConnection |
withPoolProperties(KeyValuePairSet values) |
asDataSource, closeDatabaseConnection, getConnectionName, getConnectUrl, initialiseDatabaseConnection, makeConnection, setConnectUrl, startDatabaseConnection, stopDatabaseConnection
alwaysValidateConnection, autoCommit, checkInternalState, closeConnection, connect, connectionProperties, debugMode, getAlwaysValidateConnection, getAutoCommit, getConnectionProperties, getDebugMode, getDriverImp, getPassword, getTestStatement, getUsername, initConnection, prepareConnection, setAlwaysValidateConnection, setAutoCommit, setConnectionProperties, setDebugMode, setDriverImp, setPassword, setTestStatement, setUsername, startConnection, stopConnection
connectionAttempts, connectionRetryInterval, createLoggingStatement, getConnectionAttempts, getConnectionRetryInterval, logWarning, setConnectionAttempts, setConnectionRetryInterval
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
protected PooledDataSource createPool() throws java.lang.Exception
createPool
in class JdbcPooledConnectionImpl
java.lang.Exception
public boolean equals(java.lang.Object other)
DatabaseConnection
Force implementations to over-ride equals with a semantic implementation.
equals
in class DatabaseConnection
Object.equals(java.lang.Object)
public int hashCode()
DatabaseConnection
Force implementations to over-ride hashcode.
hashCode
in class DatabaseConnection
Object.hashCode()
public ConnectionPoolBuilder getBuilder()
public void setBuilder(ConnectionPoolBuilder builder)
builder
- the builder, if not specified, then defaults to DefaultPoolFactory
.public PluggableJdbcPooledConnection withBuilder(ConnectionPoolBuilder builder)
public KeyValuePairSet getPoolProperties()
public void setPoolProperties(KeyValuePairSet kvps)
By its very nature, since we don't know what connection pool implementation is going to be used, the specific keys and values required here will be dependent on the pool implementation. Please consult their documentation to figure out the correct values.
kvps
- the connection pool properties.public KeyValuePairSet poolProperties()
public PluggableJdbcPooledConnection withPoolProperties(KeyValuePairSet values)