1
|
package eu.dnetlib.statsapi.config;
|
2
|
|
3
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
|
4
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
5
|
import org.springframework.context.annotation.Bean;
|
6
|
import org.springframework.context.annotation.Configuration;
|
7
|
import org.springframework.context.annotation.Primary;
|
8
|
|
9
|
import javax.sql.DataSource;
|
10
|
|
11
|
/**
|
12
|
* Created by tsampikos on 8/3/2017.
|
13
|
*/
|
14
|
@Configuration
|
15
|
public class DataSourceConfiguration {
|
16
|
|
17
|
@ConfigurationProperties(prefix = "statsapi.db")
|
18
|
@Bean
|
19
|
@Primary
|
20
|
public DataSource getDataSource() {
|
21
|
return DataSourceBuilder
|
22
|
.create()
|
23
|
.build();
|
24
|
}
|
25
|
}
|