public class BoneCPDataSource extends BoneCPConfig implements DataSource, ObjectFactory, Closeable
driverProperties| Constructor and Description |
|---|
BoneCPDataSource()
Default empty constructor.
|
BoneCPDataSource(BoneCPConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the datasource (i.e.
|
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() |
BoneCP |
getPool()
Returns a handle to the pool.
|
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.
|
Object |
unwrap(Class arg0)
Returns an object that implements the given interface to allow access to non-standard methods,
or standard methods not exposed by the proxy.
|
clone, getAcquireIncrement, getAcquireRetryAttempts, getAcquireRetryDelay, getAcquireRetryDelay, getAcquireRetryDelayInMs, getClassLoader, getClientInfo, 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, getPoolStrategy, getPreparedStatementCacheSize, getPreparedStatementsCacheSize, getQueryExecuteTimeLimit, getQueryExecuteTimeLimit, getQueryExecuteTimeLimitInMs, getReleaseHelperThreads, getServiceOrder, getStatementCacheSize, getStatementReleaseHelperThreads, getStatementsCachedPerConnection, getStatementsCacheSize, getUser, getUsername, hasSameConfiguration, isCloseConnectionWatch, isCloseOpenStatements, isDeregisterDriverOnClose, isDetectUnclosedStatements, isDetectUnresolvedTransactions, isDisableConnectionTracking, isDisableJMX, isExternalAuth, isLazyInit, isLogStatementsEnabled, isNullOnConnectionTimeout, isResetConnectionOnClose, isStatisticsEnabled, isTransactionRecoveryEnabled, loadClass, loadProperties, sanitize, setAcquireIncrement, setAcquireRetryAttempts, setAcquireRetryDelay, setAcquireRetryDelay, setAcquireRetryDelayInMs, setClassLoader, setClientInfo, setCloseConnectionWatch, setCloseConnectionWatchTimeout, setCloseConnectionWatchTimeout, setCloseConnectionWatchTimeoutInMs, setCloseOpenStatements, setConfigFile, setConnectionHook, setConnectionHookClassName, setConnectionTestStatement, setConnectionTimeout, setConnectionTimeout, setConnectionTimeoutInMs, setDatasourceBean, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDefaultTransactionIsolationValue, setDeregisterDriverOnClose, setDetectUnclosedStatements, setDetectUnresolvedTransactions, setDisableConnectionTracking, setDisableJMX, setDriverProperties, setExternalAuth, setIdleConnectionTestPeriod, setIdleConnectionTestPeriod, setIdleConnectionTestPeriodInMinutes, setIdleConnectionTestPeriodInSeconds, setIdleMaxAge, setIdleMaxAge, setIdleMaxAgeInMinutes, setIdleMaxAgeInSeconds, setInitSQL, setJdbcUrl, setLazyInit, setLogStatementsEnabled, setMaxConnectionAge, setMaxConnectionAge, setMaxConnectionAgeInSeconds, setMaxConnectionsPerPartition, setMinConnectionsPerPartition, setNullOnConnectionTimeout, setPartitionCount, setPassword, setPoolAvailabilityThreshold, setPoolName, setPoolStrategy, setPreparedStatementsCacheSize, setProperties, setQueryExecuteTimeLimit, setQueryExecuteTimeLimit, setQueryExecuteTimeLimitInMs, setReleaseHelperThreads, setResetConnectionOnClose, setServiceOrder, setStatementCacheSize, setStatementReleaseHelperThreads, setStatementsCachedPerConnection, setStatementsCacheSize, setStatisticsEnabled, setTransactionRecoveryEnabled, setUser, setUsername, toStringpublic BoneCPDataSource()
public BoneCPDataSource(BoneCPConfig config)
config - public Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionDataSource.getConnection()public void close()
close in interface Closeableclose in interface AutoCloseablepublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionDataSource.getConnection(java.lang.String, java.lang.String)public PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic boolean isWrapperFor(Class<?> arg0) throws SQLException
isWrapperFor in interface Wrapperarg0 - classSQLException - on errorpublic Object unwrap(Class arg0) throws SQLException
unwrap in interface Wrapperarg0 - objSQLExceptionpublic String getDriverClass()
public void setDriverClass(String driverClass)
driverClass - Driver to usepublic int getTotalLeased()
public BoneCPConfig getConfig()
public Object getObjectInstance(Object object, Name name, Context context, Hashtable<?,?> table) throws Exception
getObjectInstance in interface ObjectFactoryExceptionpublic BoneCP getPool()
Copyright © 2009-2013 JolBox. All Rights Reserved.