Skip to content
Snippets Groups Projects
Commit a9b12aed authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

connection to two datasources is finally working

parent 53ac3776
No related branches found
No related tags found
No related merge requests found
......@@ -42,9 +42,9 @@ public class PersistenceConfiguration {
@Bean
@Autowired
@Qualifier("metaJDBC")
public JdbcTemplate metaJDBC() {
return new JdbcTemplate(metaDataSource());
@Qualifier("jdbcTemplate")
public JdbcTemplate jdbcTemplate() {
return new JdbcTemplate(dataSource());
}
@Bean(name = "metaEntityManagerFactory")
......
......@@ -36,8 +36,8 @@ public class StatsApi {
ArticleRepository articleRepository;
@Autowired
@Qualifier("metaJDBC")
private JdbcTemplate metaJDBC;
@Qualifier("jdbcTemplate")
private JdbcTemplate jdbcTemplate;
@ApiOperation(value = "Get general statistics", response = GeneralStats.class)
@ApiResponses(value = {@ApiResponse(code = 200, message = "Found"), @ApiResponse(code = 404, message = "Not found") })
......@@ -56,8 +56,8 @@ public class StatsApi {
private Long countVariables()
{
LOGGER.warn("TEST DB : " + metaJDBC.queryForObject("select count(*) from information_schema.tables", Long.class)); // This is a test
Long count = metaJDBC.queryForObject("select count(*) from adni_merge", Long.class); // TODO: compute from adni_merge DB
LOGGER.warn("TEST DB : " + jdbcTemplate.queryForObject("select count(*) from information_schema.tables", Long.class)); // This is a test
Long count = jdbcTemplate.queryForObject("select count(*) from adni_merge", Long.class); // TODO: compute from adni_merge DB
return count;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment