Skip to content

Commit

Permalink
QTZ-337 Change creation of PoolingConnectionProvider so that all defi…
Browse files Browse the repository at this point in the history
…ned properties are honored.

merge 2213
  • Loading branch information
ljacomet committed Feb 19, 2013
1 parent b46da55 commit 332d3ff
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions quartz-core/src/main/java/org/quartz/impl/StdSchedulerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,40 @@ public class StdSchedulerFactory implements SchedulerFactory {

public static final String PROP_CONNECTION_PROVIDER_CLASS = "connectionProvider.class";

/**
* @deprecated Replaced with {@link PoolingConnectionProvider#DB_DRIVER}
*/
@Deprecated
public static final String PROP_DATASOURCE_DRIVER = "driver";

/**
* @deprecated Replaced with {@link PoolingConnectionProvider#DB_URL}
*/
@Deprecated
public static final String PROP_DATASOURCE_URL = "URL";

/**
* @deprecated Replaced with {@link PoolingConnectionProvider#DB_USER}
*/
@Deprecated
public static final String PROP_DATASOURCE_USER = "user";

/**
* @deprecated Replaced with {@link PoolingConnectionProvider#DB_PASSWORD}
*/
@Deprecated
public static final String PROP_DATASOURCE_PASSWORD = "password";

/**
* @deprecated Replaced with {@link PoolingConnectionProvider#DB_MAX_CONNECTIONS}
*/
@Deprecated
public static final String PROP_DATASOURCE_MAX_CONNECTIONS = "maxConnections";

/**
* @deprecated Replaced with {@link PoolingConnectionProvider#DB_VALIDATION_QUERY}
*/
@Deprecated
public static final String PROP_DATASOURCE_VALIDATION_QUERY = "validationQuery";

public static final String PROP_DATASOURCE_JNDI_URL = "jndiURL";
Expand Down Expand Up @@ -971,12 +995,8 @@ else if (schedInstId.equals(SYSTEM_PROPERTY_AS_INSTANCE_ID)) {
dbMgr = DBConnectionManager.getInstance();
dbMgr.addConnectionProvider(dsNames[i], cp);
} else {
String dsDriver = pp.getStringProperty(PROP_DATASOURCE_DRIVER);
String dsURL = pp.getStringProperty(PROP_DATASOURCE_URL);
String dsUser = pp.getStringProperty(PROP_DATASOURCE_USER, "");
String dsPass = pp.getStringProperty(PROP_DATASOURCE_PASSWORD, "");
int dsCnt = pp.getIntProperty(PROP_DATASOURCE_MAX_CONNECTIONS, 10);
String dsValidation = pp.getStringProperty(PROP_DATASOURCE_VALIDATION_QUERY);
String dsDriver = pp.getStringProperty(PoolingConnectionProvider.DB_DRIVER);
String dsURL = pp.getStringProperty(PoolingConnectionProvider.DB_URL);

if (dsDriver == null) {
initException = new SchedulerException(
Expand All @@ -991,9 +1011,7 @@ else if (schedInstId.equals(SYSTEM_PROPERTY_AS_INSTANCE_ID)) {
throw initException;
}
try {
PoolingConnectionProvider cp = new PoolingConnectionProvider(
dsDriver, dsURL, dsUser, dsPass, dsCnt,
dsValidation);
PoolingConnectionProvider cp = new PoolingConnectionProvider(pp.getUnderlyingProperties());
dbMgr = DBConnectionManager.getInstance();
dbMgr.addConnectionProvider(dsNames[i], cp);
} catch (SQLException sqle) {
Expand Down

0 comments on commit 332d3ff

Please sign in to comment.