File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
backend/src/main/java/com/ai/lawyer/global/config Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change 11package com .ai .lawyer .global .config ;
22
3+ import org .springframework .beans .factory .annotation .Value ;
34import org .springframework .boot .autoconfigure .batch .BatchDataSource ;
4- import org .springframework .boot .context .properties .ConfigurationProperties ;
55import org .springframework .boot .jdbc .DataSourceBuilder ;
66import org .springframework .context .annotation .Bean ;
77import org .springframework .context .annotation .Configuration ;
8- import org .springframework .context .annotation .Profile ;
98
109import javax .sql .DataSource ;
1110
12- /*
1311@ Configuration
14- @Profile("!test")
1512public class MetaDBConfig {
1613
14+ @ Value ("${spring.datasource-meta.jdbc-url}" )
15+ private String url ;
16+
17+ @ Value ("${spring.datasource-meta.username}" )
18+ private String username ;
19+
20+ @ Value ("${spring.datasource-meta.password}" )
21+ private String password ;
22+
23+ @ Value ("${spring.datasource-meta.driver-class-name}" )
24+ private String driver ;
25+
1726 @ Bean
1827 @ BatchDataSource
19- @ConfigurationProperties(prefix = "spring.datasource-meta")
2028 public DataSource metaDBSource () {
21- return DataSourceBuilder.create().build();
29+ return DataSourceBuilder .create ()
30+ .url (url )
31+ .username (username )
32+ .password (password )
33+ .driverClassName (driver )
34+ .build ();
2235 }
2336
24- }*/
37+ }
You can’t perform that action at this time.
0 commit comments