Fix a creation bug

Ignore the failure while creating DruidDataSource.
This commit is contained in:
DigitalSonic
2019-02-02 18:23:56 +08:00
parent bd87a038be
commit 6508554897
@@ -65,8 +65,12 @@ public class DataSourceCreator {
String username = properties.getProperty(n + ".username");
String password = properties.getProperty(n + ".password");
LOG.info("Creating " + n + " with url[" + url + "] and username[" + username + "].");
DruidDataSource dataSource = create(n, url, username, password, haDataSource);
map.put(n, dataSource);
try {
DruidDataSource dataSource = create(n, url, username, password, haDataSource);
map.put(n, dataSource);
} catch(Exception e) {
LOG.error("Can NOT create DruidDataSource for " + n, e);
}
}
LOG.info(map.size() + " DruidDataSource(s) created. ");
return map;