final JndiConnectionDefinition jcd = (JndiConnectionDefinition) connectionDefinition;
final JndiConnectionProvider provider = new JndiConnectionProvider();
provider.setConnectionPath(jcd.getJndiName());
provider.setUsername(jcd.getUsername());
provider.setPassword(jcd.getPassword());
return new SimpleDenormalizedMDXDataFactory(provider);
}
else if (connectionDefinition instanceof DriverConnectionDefinition)
{
final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;
final DriverConnectionProvider provider = new DriverConnectionProvider();
provider.setDriver(dcd.getDriverClass());
provider.setUrl(dcd.getConnectionString());
final Properties properties = dcd.getProperties();
final Enumeration keys = properties.keys();
while (keys.hasMoreElements())
{
final String key = (String) keys.nextElement();
provider.setProperty(key, properties.getProperty(key));
}
return new SimpleDenormalizedMDXDataFactory(provider);
}
else
{
return null;
}