.build();
} else if ("fs".equalsIgnoreCase(database)) {
String tmpdir = System.getProperty("java.io.tmpdir");
String dbname = env.getProperty("application.name", "testdb");
String jdbcUrl = "jdbc:h2:" + tmpdir + File.separator + dbname;
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
@SuppressWarnings("unchecked")
Class<? extends Driver> driverClass =
(Class<? extends Driver>) ClassUtils.forName(H2_DRIVER,
DataSources.class.getClassLoader());
dataSource.setDriverClass(driverClass);
dataSource.setUrl(jdbcUrl);
dataSource.setUsername("sa");
dataSource.setPassword("");
logger.info("Creating embedded database: '{}'", jdbcUrl);
return dataSource;
} else {
return null;
}