JdbcTemplate template = new JdbcTemplate();
template.setDataSource(datasource);
template.setNativeJdbcExtractor(new CommonsDbcpNativeJdbcExtractor());
context.getBeanFactory().registerSingleton("statsInterfaceTemplate", template);
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
transactionManager.setDataSource(datasource);
context.getBeanFactory().registerSingleton("statsTransactionManager", transactionManager);
RunStatsManager rsm = new RunStatsManager(template);
context.getBeanFactory().registerSingleton("runStatsManager", rsm);
}