Skip to content

Commit 663d5d4

Browse files
committed
Merge pull request #28712 from vpavic
* pr/28712: Fix "Configure Two DataSources" example Closes gh-28712
2 parents de172a5 + c8dd0a5 commit 663d5d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/dataaccess/configuretwodatasources/MyCompleteDataSourcesConfiguration.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.zaxxer.hikari.HikariDataSource;
2020
import org.apache.commons.dbcp2.BasicDataSource;
2121

22+
import org.springframework.beans.factory.annotation.Qualifier;
2223
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
2324
import org.springframework.boot.context.properties.ConfigurationProperties;
2425
import org.springframework.context.annotation.Bean;
@@ -50,7 +51,8 @@ public DataSourceProperties secondDataSourceProperties() {
5051

5152
@Bean
5253
@ConfigurationProperties("app.datasource.second.configuration")
53-
public BasicDataSource secondDataSource(DataSourceProperties secondDataSourceProperties) {
54+
public BasicDataSource secondDataSource(
55+
@Qualifier("secondDataSourceProperties") DataSourceProperties secondDataSourceProperties) {
5456
return secondDataSourceProperties.initializeDataSourceBuilder().type(BasicDataSource.class).build();
5557
}
5658

0 commit comments

Comments
 (0)