|
@@ -0,0 +1,19 @@
|
|
1
|
+package com.example.throwupthursday.config;
|
|
2
|
+
|
|
3
|
+import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
4
|
+import org.springframework.boot.jdbc.DataSourceBuilder;
|
|
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
|
+@Configuration
|
|
12
|
+public class DatabaseConfig {
|
|
13
|
+ @Bean
|
|
14
|
+ @Primary
|
|
15
|
+ @ConfigurationProperties(prefix = "spring.datasource")
|
|
16
|
+ public DataSource dataSource() {
|
|
17
|
+ return DataSourceBuilder.create().build();
|
|
18
|
+ }
|
|
19
|
+}
|