|
@@ -77,8 +77,8 @@ public class DBUtil {
|
|
|
String url = PropertiesUtil.getString(dataSourceName + ".url");
|
|
|
String userName = PropertiesUtil.getString(dataSourceName + ".username");
|
|
|
String password = PropertiesUtil.getString(dataSourceName + ".password");
|
|
|
- int initialPoolSize = PropertiesUtil.getInt(dataSourceName + ".initialPoolSize", 2);
|
|
|
- int minPoolSize = PropertiesUtil.getInt(dataSourceName + ".minPoolSize", 2);
|
|
|
+ int initialPoolSize = PropertiesUtil.getInt(dataSourceName + ".initialPoolSize", 1);
|
|
|
+ int minPoolSize = PropertiesUtil.getInt(dataSourceName + ".minPoolSize", 1);
|
|
|
int maxPoolSize = PropertiesUtil.getInt(dataSourceName + ".maxPoolSize", 10);
|
|
|
|
|
|
DataSource dataSource = null;
|
|
@@ -92,10 +92,10 @@ public class DBUtil {
|
|
|
implementation.getMethod("setJdbcUrl", String.class).invoke(c3po, url);
|
|
|
implementation.getMethod("setUser", String.class).invoke(c3po, userName);
|
|
|
implementation.getMethod("setPassword", String.class).invoke(c3po, password);
|
|
|
- implementation.getMethod("setInitialPoolSize", Integer.class).invoke(c3po,
|
|
|
+ implementation.getMethod("setInitialPoolSize", int.class).invoke(c3po,
|
|
|
initialPoolSize);
|
|
|
- implementation.getMethod("setMinPoolSize", Integer.class).invoke(c3po, minPoolSize);
|
|
|
- implementation.getMethod("setMaxPoolSize", Integer.class).invoke(c3po, maxPoolSize);
|
|
|
+ implementation.getMethod("setMinPoolSize", int.class).invoke(c3po, minPoolSize);
|
|
|
+ implementation.getMethod("setMaxPoolSize", int.class).invoke(c3po, maxPoolSize);
|
|
|
implementation.getMethod("setPreferredTestQuery", String.class).invoke(c3po,
|
|
|
"select 1 from dual");
|
|
|
|
|
@@ -104,8 +104,8 @@ public class DBUtil {
|
|
|
try {
|
|
|
Class<?> dataSourcesClass = Class
|
|
|
.forName("com.mchange.v2.c3p0.DataSources");
|
|
|
- dataSourcesClass.getMethod("destroy", DataSource.class, Boolean.class)
|
|
|
- .invoke(null, c3po);
|
|
|
+ dataSourcesClass.getMethod("destroy", DataSource.class).invoke(null,
|
|
|
+ c3po);
|
|
|
DataSources.destroy(c3po);
|
|
|
} catch (Exception e) {
|
|
|
LOG.error("[JDBC] Fail to destroy dataSource. dataSourceName="
|
|
@@ -123,9 +123,9 @@ public class DBUtil {
|
|
|
implementation.getMethod("setUrl", String.class).invoke(druid, url);
|
|
|
implementation.getMethod("setUsername", String.class).invoke(druid, userName);
|
|
|
implementation.getMethod("setPassword", String.class).invoke(druid, password);
|
|
|
- implementation.getMethod("setInitialSize", Integer.class).invoke(druid,
|
|
|
+ implementation.getMethod("setInitialSize", int.class).invoke(druid,
|
|
|
initialPoolSize);
|
|
|
- implementation.getMethod("setMaxActive", Integer.class).invoke(druid, maxPoolSize);
|
|
|
+ implementation.getMethod("setMaxActive", int.class).invoke(druid, maxPoolSize);
|
|
|
|
|
|
implementation.getMethod("setValidationQuery", String.class).invoke(druid,
|
|
|
"select 1 from dual");
|