// Default to JDBC.
JDBCRepositoryFactory factory =
JDBCRepositoryFactory.getDefaultInstance();
MCSDriverConfiguration driverConfiguration =
factory.createMCSDriverConfiguration();
driverConfiguration.setSource(
Environment.getParameter(config, "odbc-source"));
String vendor = Environment.getParameter(config, "odbc-vendor");
JDBCRepositoryType jdbcRepositoryType =
JDBCRepositoryType.getTypeForVendor(vendor);
if (jdbcRepositoryType != null) {
driverConfiguration.setDriverVendor(
jdbcRepositoryType.getVendor());
}
driverConfiguration.setHost(Environment.getParameter(config,
"odbc-host"));
String port = Environment.getParameter(config, "odbc-port");
if (port != null) {
driverConfiguration.setPort(Integer.parseInt(port));
}
DataSource dataSource = factory.createMCSDriverDataSource(
driverConfiguration);