Problems encountered when SpringBoot configures multiple data sources

SpringBoot configures multiple data sources

Reference code: Spring Boot 1.5.8.RELEASE configure Oracle and MySQL at the same time

The original author used SpringBoot version 1.5.8. After upgrading to 2.0.*, the DataSourceBuilder has changed

//import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.jdbc.DataSourceBuilder;

 

Report data source error: jdbcUrl is required with driverClassName.

It seems to be because the hikari connection pool is configured by default

Use spring.datasource.jdbc-url in the configuration file instead of the usual spring.datasource.url. 

#spring.datasource.primary.url=***
spring.datasource.primary.jdbc-url=***

Reference: springboot2.0 multiple data source error: jdbcUrl is required with driverClassName.

           Spring Boot 2.0 Multiple Data Source Programming

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324594073&siteId=291194637