Class<?> driverClass = getDriverClass();
DBPool pool = new DBPool();
pool.setName(getName());
DriverConfig driver = pool.createDriver();
driver.setType(driverClass);
ConfigType<?> configType = TypeFactory.getType(driverClass);
if (getUrl() != null) {
if (configType.getAttribute(URL) != null
|| Driver.class.isAssignableFrom(driverClass)) {
driver.setURL(getUrl());
}
}
if (getDatabaseName() != null) {
driver.setProperty("database-name", getDatabaseName());
}
if (getUser() != null)
driver.setUser(getUser());
if (getPassword() != null)
driver.setPassword(getPassword());
try {
driver.init();
pool.init();
} catch (Exception e) {
e.printStackTrace();
throw ConfigException.create(e);