mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved configFromProperty.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user