improved configFromProperty.

This commit is contained in:
wenshao
2017-08-23 13:57:59 +08:00
parent c370d70188
commit 0c46c2a165
@@ -388,12 +388,34 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
if (property != null && property.length() > 0) {
try {
int value = Integer.parseInt(property);
super.setInitialSize(value);
this.setInitialSize(value);
} catch (NumberFormatException e) {
LOG.error("illegal property 'druid.initialSize'", e);
}
}
}
{
String property = properties.getProperty("druid.minIdle");
if (property != null && property.length() > 0) {
try {
int value = Integer.parseInt(property);
this.setMinIdle(value);
} catch (NumberFormatException e) {
LOG.error("illegal property 'druid.minIdle'", e);
}
}
}
{
String property = properties.getProperty("druid.maxActive");
if (property != null && property.length() > 0) {
try {
int value = Integer.parseInt(property);
this.setMaxActive(value);
} catch (NumberFormatException e) {
LOG.error("illegal property 'druid.maxActive'", e);
}
}
}
{
Boolean value = getBoolean(properties, "druid.killWhenSocketReadTimeout");
if (value != null) {