if (db.isEnabled())
{
for (Iterator itr = db.getFragmentIterator(); itr.hasNext();)
{
RelationalDatabaseFragment fragment = (RelationalDatabaseFragment)itr.next();
J2EEResourceRef ref = new J2EEResourceRef("jdbc/" + db.getName() + fragment.getSuffix(),
SysUtil.NAMESPACE + "/jdbc/" + fragment.getAlias(),
"javax.sql.DataSource", fragment.getUser());
// assume nexj.core.rpc.sql.ra.SQLManagedConnectionFactory
if (nPart == XMLMetadataExporter.J2EE_PLATFORM_CONNECTION_FACTORY)
{
if (!fragment.isFirst())
{
continue;
}
RelationalDatabase ds = (RelationalDatabase)fragment.getDataSource();
SQLAdapter adapter = (SQLAdapter)ds.getComponent().getInstance(null);
String sDataSourceClass = ds.getDriver();
ref.addProperty(new J2EEProperty("name", ds.getName()));
ref.addProperty(new J2EEProperty("dataSource", sDataSourceClass));
ref.addProperty(new J2EEProperty("initialSQL", adapter.getInitialSQL()));
ref.addProperty(new J2EEProperty("password", fragment.getPassword()));
ref.addProperty(new J2EEProperty("properties",
PropertyUtil.toString(fragment.getPropertyHolder().getProperties())));
ref.addProperty(new J2EEProperty("statementCacheSize", fragment.getStatementCacheSize()));
ref.addProperty(new J2EEProperty("testSQL", adapter.getTestSQL()));
ref.addProperty(new J2EEProperty("user", fragment.getUser()));
ref.addProperty(new J2EEProperty("isolationLevel",
Connection.TRANSACTION_READ_COMMITTED));
}
ref.setIsolationLevel(Connection.TRANSACTION_READ_COMMITTED);
m_exporter.exportJ2EEResourceRef(ref, nPart, sNamespace, nContainer, nContext);
}
}
break;