public abstract class BasePooledConnectionProvider extends Object implements PooledConnectionProvider
PooledConnectionProvider. Plugin authors should:
getDriverClass() method| Modifier and Type | Field and Description |
|---|---|
static String |
DRIVER_CLASS
Driver class key.
|
static String |
PASSWORD
JDBC password config key.
|
protected org.rhq.core.domain.configuration.Configuration |
pluginConfig |
static String |
TIMEOUT
Connection timeout setting.
|
static String |
TRACK
If true, track connections and statements.
|
static String |
URL
JDBC URL config key.
|
static String |
USERNAME
JDBC username config key.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BasePooledConnectionProvider(org.rhq.core.domain.configuration.Configuration pluginConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shutdown the connection pool.
|
protected Properties |
getConnectionProperties()
Return additional database connection pool properties.
|
protected long |
getConnectionTimeout()
Return the connection timeout setting, in milliseconds.
|
protected Class<Driver> |
getDriverClass()
Returns the driver class, by default the name from
getDriverClassName(). |
protected String |
getDriverClassName()
Returns the driver class, by default configuration item
DRIVER_CLASS. |
protected String |
getJdbcUrl()
Implemented by subclasses to return the JDBC connection URL.
|
protected String |
getPassword()
Return the JDBC password.
|
Connection |
getPooledConnection()
Get a pooled connection.
|
protected String |
getUsername()
Return the JDBC username.
|
public static final String DRIVER_CLASS
public static final String URL
public static final String USERNAME
public static final String PASSWORD
public static final String TRACK
public static final String TIMEOUT
protected final org.rhq.core.domain.configuration.Configuration pluginConfig
public Connection getPooledConnection() throws SQLException
PooledConnectionProviderConnection.close() on the returned Connection object.getPooledConnection in interface PooledConnectionProviderConnectionSQLException - if a pooled connection could not be retrievedprotected Properties getConnectionProperties()
protected Class<Driver> getDriverClass() throws ClassNotFoundException
getDriverClassName().
If not configured, this assumes the plugin will load the appropriate driver.ClassNotFoundException - if the classloader could not load this classprotected String getDriverClassName() throws ClassNotFoundException
DRIVER_CLASS.ClassNotFoundExceptionprotected String getJdbcUrl()
URL.protected String getUsername()
USERNAME.protected String getPassword()
PASSWORD.protected long getConnectionTimeout()
TIMEOUT.public void close()
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.