try {
// Build spring context
ctx = new ClassPathXmlApplicationContext(contextFiles);
ctx.getBeanFactory().autowireBeanProperties(this, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, false);
final PropertyDataSource ds = ctx.getBean("dataSource", PropertyDataSource.class);
this.databaseUrl = ds.getUrl();
final JdbcTemplate jdbc = new JdbcTemplate(ds);
try {
jdbc.execute("CHECKPOINT DEFRAG");
} catch (final org.springframework.jdbc.BadSqlGrammarException ex) {
// ignore