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 { ...@@ -42,9 +42,9 @@ public class PersistenceConfiguration {
@Bean @Bean
@Autowired @Autowired
@Qualifier("metaJDBC") @Qualifier("jdbcTemplate")
public JdbcTemplate metaJDBC() { public JdbcTemplate jdbcTemplate() {
return new JdbcTemplate(metaDataSource()); return new JdbcTemplate(dataSource());
} }
@Bean(name = "metaEntityManagerFactory") @Bean(name = "metaEntityManagerFactory")
......
...@@ -36,8 +36,8 @@ public class StatsApi { ...@@ -36,8 +36,8 @@ public class StatsApi {
ArticleRepository articleRepository; ArticleRepository articleRepository;
@Autowired @Autowired
@Qualifier("metaJDBC") @Qualifier("jdbcTemplate")
private JdbcTemplate metaJDBC; private JdbcTemplate jdbcTemplate;
@ApiOperation(value = "Get general statistics", response = GeneralStats.class) @ApiOperation(value = "Get general statistics", response = GeneralStats.class)
@ApiResponses(value = {@ApiResponse(code = 200, message = "Found"), @ApiResponse(code = 404, message = "Not found") }) @ApiResponses(value = {@ApiResponse(code = 200, message = "Found"), @ApiResponse(code = 404, message = "Not found") })
...@@ -56,8 +56,8 @@ public class StatsApi { ...@@ -56,8 +56,8 @@ public class StatsApi {
private Long countVariables() private Long countVariables()
{ {
LOGGER.warn("TEST DB : " + metaJDBC.queryForObject("select count(*) from information_schema.tables", Long.class)); // This is a test LOGGER.warn("TEST DB : " + jdbcTemplate.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 Long count = jdbcTemplate.queryForObject("select count(*) from adni_merge", Long.class); // TODO: compute from adni_merge DB
return count; 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