summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/libertacasa/pubsh/web/DatabaseBean.java
blob: 889a92c65e9647f0138ce44bde582d665a0921c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package net.libertacasa.pubsh.web;

import javax.sql.DataSource;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class DatabaseBean {
	@Bean
	@Primary
	@ConfigurationProperties(prefix="spring.datasource")
	public static DataSource dataSource() {
	    return DataSourceBuilder.create().build();
	}
}