|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.utils.PoolingConnectionProvider
public class PoolingConnectionProvider
A ConnectionProvider
implementation that creates its own
pool of connections.
This class uses DBCP, an Apache-Jakarta-Commons product.
DBConnectionManager
,
ConnectionProvider
Field Summary | |
---|---|
static java.lang.String |
DB_DRIVER
The JDBC database driver. |
static java.lang.String |
DB_IDLE_VALIDATION_SECONDS
The number of seconds between tests of idle connections - only enabled if the validation query property is set. |
static java.lang.String |
DB_MAX_CACHED_STATEMENTS_PER_CONNECTION
The maximum number of prepared statements that will be cached per connection in the pool. |
static java.lang.String |
DB_MAX_CONNECTIONS
The maximum number of database connections to have in the pool. |
static java.lang.String |
DB_PASSWORD
The database user password. |
static java.lang.String |
DB_URL
The JDBC database URL. |
static java.lang.String |
DB_USER
The database user name. |
static java.lang.String |
DB_VALIDATE_ON_CHECKOUT
Whether the database sql query to validate connections should be executed every time a connection is retrieved from the pool to ensure that it is still valid. |
static java.lang.String |
DB_VALIDATION_QUERY
The database sql query to execute every time a connection is returned to the pool to ensure that it is still valid. |
static int |
DEFAULT_DB_MAX_CACHED_STATEMENTS_PER_CONNECTION
Default maximum number of database connections in the pool. |
static int |
DEFAULT_DB_MAX_CONNECTIONS
Default maximum number of database connections in the pool. |
Constructor Summary | |
---|---|
PoolingConnectionProvider(java.util.Properties config)
Create a connection pool using the given properties. |
|
PoolingConnectionProvider(java.lang.String dbDriver,
java.lang.String dbURL,
java.lang.String dbUser,
java.lang.String dbPassword,
int maxConnections,
java.lang.String dbValidationQuery)
|
Method Summary | |
---|---|
java.sql.Connection |
getConnection()
|
protected com.mchange.v2.c3p0.ComboPooledDataSource |
getDataSource()
Get the C3PO ComboPooledDataSource created during initialization. |
void |
shutdown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DB_DRIVER
public static final java.lang.String DB_URL
public static final java.lang.String DB_USER
public static final java.lang.String DB_PASSWORD
public static final java.lang.String DB_MAX_CONNECTIONS
public static final java.lang.String DB_MAX_CACHED_STATEMENTS_PER_CONNECTION
public static final java.lang.String DB_VALIDATION_QUERY
public static final java.lang.String DB_IDLE_VALIDATION_SECONDS
public static final java.lang.String DB_VALIDATE_ON_CHECKOUT
public static final int DEFAULT_DB_MAX_CONNECTIONS
public static final int DEFAULT_DB_MAX_CACHED_STATEMENTS_PER_CONNECTION
Constructor Detail |
---|
public PoolingConnectionProvider(java.lang.String dbDriver, java.lang.String dbURL, java.lang.String dbUser, java.lang.String dbPassword, int maxConnections, java.lang.String dbValidationQuery) throws java.sql.SQLException, SchedulerException
java.sql.SQLException
SchedulerException
public PoolingConnectionProvider(java.util.Properties config) throws SchedulerException, java.sql.SQLException
The properties passed should contain:
DB_DRIVER
- The database driver class name
DB_URL
- The database URL
DB_USER
- The database user
DB_PASSWORD
- The database password
DB_MAX_CONNECTIONS
- The maximum # connections in the pool,
optional
DB_VALIDATION_QUERY
- The sql validation query, optional
config
- configuration properties
SchedulerException
java.sql.SQLException
Method Detail |
---|
protected com.mchange.v2.c3p0.ComboPooledDataSource getDataSource()
This can be used to set additional data source properties in a subclass's constructor.
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface ConnectionProvider
java.sql.SQLException
public void shutdown() throws java.sql.SQLException
shutdown
in interface ConnectionProvider
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |