return conn;
}
private DBDatabaseDriver getDatabaseDriver(SampleConfig config, Connection conn) {
if (config.databaseProvider.equalsIgnoreCase("sqlite")) {
DBDatabaseDriverSQLite driver = new DBDatabaseDriverSQLite();
return driver;
}
if (config.databaseProvider.equalsIgnoreCase("mysql")) {
DBDatabaseDriverMySQL driver = new DBDatabaseDriverMySQL();
driver.setDatabaseName(config.schemaName);
return driver;
}
if (config.databaseProvider.equalsIgnoreCase("oracle")) {
DBDatabaseDriverOracle driver = new DBDatabaseDriverOracle();
return driver;
}
if (config.databaseProvider.equalsIgnoreCase("sqlserver")) {
DBDatabaseDriverMSSQL driver = new DBDatabaseDriverMSSQL();
driver.setDatabaseName(config.schemaName);
return driver;
}
if (config.databaseProvider.equalsIgnoreCase("hsqldb")) {
DBDatabaseDriverHSql driver = new DBDatabaseDriverHSql();
return driver;
}
if (config.databaseProvider.equalsIgnoreCase("postgresql")) {
DBDatabaseDriverPostgreSQL driver = new DBDatabaseDriverPostgreSQL();
driver.setDatabaseName(config.schemaName);
return driver;
}
if (config.databaseProvider.equalsIgnoreCase("h2")) {
DBDatabaseDriverH2 driver = new DBDatabaseDriverH2();
driver.setDatabaseName(config.schemaName);
return driver;
}
if (config.databaseProvider.equalsIgnoreCase("derby")) {
DBDatabaseDriverDerby driver = new DBDatabaseDriverDerby();
driver.setDatabaseName(config.schemaName);
return driver;
}
throw new RuntimeException("Unknown Database Provider " + config.databaseProvider);
}