public class BoneCPDataSource extends com.jolbox.bonecp.BoneCPConfig implements DataSource, ObjectFactory
| Constructor and Description |
|---|
BoneCPDataSource()
Default empty constructor.
|
BoneCPDataSource(com.jolbox.bonecp.BoneCPConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the datasource.
|
com.jolbox.bonecp.BoneCPConfig |
getConfig()
Returns a configuration object built during initialization of the connection pool.
|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
String |
getDriverClass()
Gets driver class set in config.
|
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.
|
PrintWriter |
getLogWriter()
Retrieves the log writer for this DataSource object.
|
Object |
getObjectInstance(Object object,
Name name,
Context context,
Hashtable<?,?> table) |
Logger |
getParentLogger() |
int |
getTotalLeased()
Returns the total leased connections.
|
boolean |
isWrapperFor(Class<?> arg0)
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
|
void |
setDriverClass(String driverClass)
Sets driver to use (called via reflection).
|
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.
|
void |
setLogWriter(PrintWriter out)
Sets the log writer for this DataSource object to the given java.io.PrintWriter object.
|
<T> T |
unwrap(Class<T> iface) |
clone, getAcquireIncrement, getAcquireRetryAttempts, getAcquireRetryDelay, getAcquireRetryDelay, getAcquireRetryDelayInMs, getClassLoader, getCloseConnectionWatchTimeout, getCloseConnectionWatchTimeout, getCloseConnectionWatchTimeoutInMs, getConfigFile, getConnectionHook, getConnectionHookClassName, getConnectionTestStatement, getConnectionTimeout, getConnectionTimeout, getConnectionTimeoutInMs, getDatasourceBean, getDefaultAutoCommit, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDefaultTransactionIsolationValue, getDriverProperties, getIdleConnectionTestPeriod, getIdleConnectionTestPeriod, getIdleConnectionTestPeriodInMinutes, getIdleMaxAge, getIdleMaxAge, getIdleMaxAgeInMinutes, getInitSQL, getJdbcUrl, getMaxConnectionAge, getMaxConnectionAge, getMaxConnectionAgeInSeconds, getMaxConnectionsPerPartition, getMinConnectionsPerPartition, getPartitionCount, getPassword, getPoolAvailabilityThreshold, getPoolName, getPreparedStatementCacheSize, getPreparedStatementsCacheSize, getQueryExecuteTimeLimit, getQueryExecuteTimeLimit, getQueryExecuteTimeLimitInMs, getReleaseHelperThreads, getServiceOrder, getStatementCacheSize, getStatementReleaseHelperThreads, getStatementsCachedPerConnection, getStatementsCacheSize, getUsername, hasSameConfiguration, isCloseConnectionWatch, isDisableConnectionTracking, isDisableJMX, isExternalAuth, isLazyInit, isLogStatementsEnabled, isStatisticsEnabled, isTransactionRecoveryEnabled, loadClass, loadProperties, sanitize, setAcquireIncrement, setAcquireRetryAttempts, setAcquireRetryDelay, setAcquireRetryDelay, setAcquireRetryDelayInMs, setClassLoader, setCloseConnectionWatch, setCloseConnectionWatchTimeout, setCloseConnectionWatchTimeout, setCloseConnectionWatchTimeoutInMs, setConfigFile, setConnectionHook, setConnectionHookClassName, setConnectionTestStatement, setConnectionTimeout, setConnectionTimeout, setConnectionTimeoutInMs, setDatasourceBean, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDefaultTransactionIsolationValue, setDisableConnectionTracking, setDisableJMX, setDriverProperties, setExternalAuth, setIdleConnectionTestPeriod, setIdleConnectionTestPeriod, setIdleConnectionTestPeriodInMinutes, setIdleConnectionTestPeriodInSeconds, setIdleMaxAge, setIdleMaxAge, setIdleMaxAgeInMinutes, setIdleMaxAgeInSeconds, setInitSQL, setJdbcUrl, setLazyInit, setLogStatementsEnabled, setMaxConnectionAge, setMaxConnectionAge, setMaxConnectionAgeInSeconds, setMaxConnectionsPerPartition, setMinConnectionsPerPartition, setPartitionCount, setPassword, setPoolAvailabilityThreshold, setPoolName, setPreparedStatementsCacheSize, setProperties, setQueryExecuteTimeLimit, setQueryExecuteTimeLimit, setQueryExecuteTimeLimitInMs, setReleaseHelperThreads, setServiceOrder, setStatementCacheSize, setStatementReleaseHelperThreads, setStatementsCachedPerConnection, setStatementsCacheSize, setStatisticsEnabled, setTransactionRecoveryEnabled, setUsername, toStringpublic BoneCPDataSource()
public BoneCPDataSource(com.jolbox.bonecp.BoneCPConfig config)
config - the configurationpublic void close()
public com.jolbox.bonecp.BoneCPConfig getConfig()
public Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionDataSource.getConnection()public Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionDataSource.getConnection(java.lang.String, java.lang.String)public String getDriverClass()
public int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic Object getObjectInstance(Object object, Name name, Context context, Hashtable<?,?> table) throws Exception
getObjectInstance in interface ObjectFactoryExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic int getTotalLeased()
public boolean isWrapperFor(Class<?> arg0) throws SQLException
isWrapperFor in interface Wrapperarg0 - classSQLException - on errorpublic void setDriverClass(String driverClass)
driverClass - Driver to usepublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionCopyright © 2012-2013 Batoo. All Rights Reserved.