use of org.flywaydb.sample.resolver.SampleResolver in project flyway by flyway.
the class Main method main.
/**
* Runs the sample.
*
* @param args None supported.
*/
public static void main(String[] args) throws Exception {
Flyway flyway = new Flyway();
flyway.setDataSource("jdbc:hsqldb:file:db/flyway_sample;shutdown=true", "SA", "");
flyway.setLocations("db/migration", "org.flywaydb.sample.migration");
flyway.setResolvers(new SampleResolver());
flyway.migrate();
SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(flyway.getDataSource());
List<Map<String, Object>> results = jdbcTemplate.queryForList("select name from test_user");
for (Map<String, Object> result : results) {
System.out.println("Name: " + result.get("NAME"));
}
}
Aggregations