草庐IT

SimpleHttpServerJaxWsServiceExpor

全部标签

java - 在 Spring-Boot 中,我们如何在同一个项目中连接两个数据库(Mysql 数据库和 MongoDB)?

我正在尝试创建一个“Spring-Boot”项目,在该项目中我需要连接到不同的数据库“MySql”和“MongoDB”。我需要做一些特殊的事情来连接到两个数据库,否则spring-boot会自动连接到两个数据库。我还需要为“mongodb”定义数据源吗?MySQL特定的“YML”文件如下所示#DefaultDBparameterdefinitionsfortheURLparametersinthespring.datasource.urlpropertybelowdatabase:host:localhostport:3306schema:subscriptionsusername:r

java - 在 Spring-Boot 中,我们如何在同一个项目中连接两个数据库(Mysql 数据库和 MongoDB)?

我正在尝试创建一个“Spring-Boot”项目,在该项目中我需要连接到不同的数据库“MySql”和“MongoDB”。我需要做一些特殊的事情来连接到两个数据库,否则spring-boot会自动连接到两个数据库。我还需要为“mongodb”定义数据源吗?MySQL特定的“YML”文件如下所示#DefaultDBparameterdefinitionsfortheURLparametersinthespring.datasource.urlpropertybelowdatabase:host:localhostport:3306schema:subscriptionsusername:r