|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 String |
DB_DRIVER
The JDBC database driver. |
static String |
DB_MAX_CONNECTIONS
The maximum number of database connections to have in the pool. |
static String |
DB_PASSWORD
The database user password. |
static String |
DB_URL
The JDBC database URL. |
static String |
DB_USER
The database user name. |
static String |
DB_VALIDATION_QUERY
The database sql query to execute everytime a connection is retrieved from the pool to ensure that it is still valid. |
static int |
DEFAULT_DB_MAX_CONNECTIONS
Default maximum number of database connections in the pool. |
| Constructor Summary | |
|---|---|
PoolingConnectionProvider(Properties config)
Create a connection pool using the given properties. |
|
PoolingConnectionProvider(String dbDriver,
String dbURL,
String dbUser,
String dbPassword,
int maxConnections,
String dbValidationQuery)
|
|
| Method Summary | |
|---|---|
Connection |
getConnection()
|
protected org.apache.commons.dbcp.BasicDataSource |
getDataSource()
Get the DBCP BasicDataSource 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 String DB_DRIVER
public static final String DB_URL
public static final String DB_USER
public static final String DB_PASSWORD
public static final String DB_MAX_CONNECTIONS
public static final String DB_VALIDATION_QUERY
public static final int DEFAULT_DB_MAX_CONNECTIONS
| Constructor Detail |
|---|
public PoolingConnectionProvider(String dbDriver,
String dbURL,
String dbUser,
String dbPassword,
int maxConnections,
String dbValidationQuery)
throws SQLException
SQLException
public PoolingConnectionProvider(Properties config)
throws 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
SQLException| Method Detail |
|---|
protected org.apache.commons.dbcp.BasicDataSource getDataSource()
This can be used to set additional data source properties in a subclass's constructor.
public Connection getConnection()
throws SQLException
getConnection in interface ConnectionProviderSQLException
public void shutdown()
throws SQLException
shutdown in interface ConnectionProviderSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||