【问题标题】:Can you connect to two postgres databases in Springboot?您可以在 Spring Boot 中连接到两个 postgres 数据库吗?
【发布时间】:2017-03-25 10:45:31
【问题描述】:

如果是,怎么做?

我正在编写一个存档项目,其中必须将一个数据库中的旧数据移动到另一个数据库。为此,我需要连接到 springboot 项目中的两个数据库。

任何指针将不胜感激。

【问题讨论】:

    标签: postgresql spring-boot jdbctemplate


    【解决方案1】:

    您需要提供两个不同的DataSources(两个不同的bean)。

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

    【讨论】:

      猜你喜欢
      • 2022-08-18
      • 2023-03-23
      • 2017-06-11
      • 2019-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-21
      • 2018-11-08
      相关资源
      最近更新 更多