definition.setConnectionInstance(new ConnectionDefinitionInstance[]{instance});
instance.setName(data.getName());
ConfigPropertySetting[] settings = instance.getConfigPropertySetting();
if(data.isGeneric()) { // it's a generic TranQL JDBC pool
for (int i = 0; i < settings.length; i++) {
ConfigPropertySetting setting = settings[i];
if(setting.getName().equals("UserName")) {
setting.setValue(data.user);
} else if(setting.getName().equals("Password")) {
setting.setValue(data.password);
} else if(setting.getName().equals("ConnectionURL")) {
setting.setValue(data.url);
} else if(setting.getName().equals("Driver")) {
setting.setValue(data.driverClass);
}
}
} else { // it's an XA driver or non-TranQL RA
for (int i = 0; i < settings.length; i++) {
ConfigPropertySetting setting = settings[i];
String value = (String) data.properties.get("property-"+setting.getName());
setting.setValue(value == null ? "" : value);
}
}
ConnectionManager manager = instance.getConnectionManager();
manager.setTransactionLocal(true);
SinglePool pool = new SinglePool();