String defaultProject, String defaultDeviceProject)
throws Exception {
InternalJDBCRepository repository = null;
JDBCRepositoryFactory factory =
JDBCRepositoryFactory.getDefaultInstance();
MCSDriverConfiguration driverConfiguration =
factory.createMCSDriverConfiguration();
driverConfiguration.setDriverVendor(JDBCDriverVendor.HYPERSONIC);
driverConfiguration.setSource(source);
DataSource dataSource =
factory.createMCSDriverDataSource(driverConfiguration);
JDBCRepositoryConfiguration configuration =
factory.createJDBCRepositoryConfiguration();
configuration.setDataSource(dataSource);
configuration.setUsername(HypersonicManager.DEFAULT_USERNAME);
configuration.setPassword(HypersonicManager.DEFAULT_PASSWORD);
// HashMap properties = new HashMap();
// properties.put(JDBCRepository.VENDOR_PROPERTY,
// JDBCRepository.VENDOR_HYPERSONIC);
// properties.put(JDBCRepository.SOURCE_PROPERTY,
// source);
// properties.put(JDBCRepository.USERNAME_PROPERTY,
// HypersonicManager.DEFAULT_USERNAME);
// properties.put(JDBCRepository.PASSWORD_PROPERTY,
// HypersonicManager.DEFAULT_PASSWORD);
// properties.put(JDBCRepository.DEFAULT_PROJECT_NAME_PROPERTY,
// defaultProject);
// properties.put(JDBCRepository.STANDARD_DEVICE_PROJECT_NAME_PROPERTY,
// defaultDeviceProject);
// repository = (InternalJDBCRepository)
// JDBCRepository.createRepository(properties).getLocalRepository();
repository = (InternalJDBCRepository)
factory.createJDBCRepository(configuration);
return repository;
}