String database = InjectHelper.instanceWithName(String.class, "org.socialmusicdiscovery.server.database");
DatabaseProvider provider = InjectHelper.instanceWithName(DatabaseProvider.class, database);
try {
progressHandler.progress(getId(),"Deleting database contents",1L,2L);
Connection connection = provider.getConnection();
Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database-drop.xml", new
ClassLoaderResourceAccessor(),
new JdbcConnection(connection));
liquibase.update("");
progressHandler.progress(getId(), "Creating fresh database", 2L, 2L);
liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
ClassLoaderResourceAccessor(),
new JdbcConnection(connection));
liquibase.update("");
progressHandler.finished(getId());
} catch (LiquibaseException e) {
progressHandler.failed(getId(),e.getMessage());
} catch (SQLException e) {
e.printStackTrace();