Using 2 beans of the same type: javax.sql.DataSource in Spring

前端 未结 4 1042
南笙
南笙 2021-01-01 19:45

I am developing a Spring Boot based application in which I would like to create 2 beans: One will point to \'Oracle\' database; the other will point to Hive. I\'ve declar

4条回答
  •  渐次进展
    2021-01-01 20:02

    Set one of the beam as @Primary as described in the section 67.2 Configure Two DataSources

    http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-two-datasources

提交回复
热议问题