jdbcUrl is required with driverClassName
https://blog.csdn.net/newbie_907486852/article/details/81391525
springboot2.0配置多数据源:
spring.datasource.primary.url=jdbc:mysql://localhost:3306/study?useUnicode=true&characterEncoding=utf-8&useSSL=true
spring.datasource.primary.username=root
spring.datasource.primary.password=root
spring.datasource.primary.driver-class=com.mysql.cj.jdbc.Driver
spring.datasource.secondary.url=jdbc:mysql://localhost:3306/study?useUnicode=true&characterEncoding=utf-8&useSSL=true
spring.datasource.secondary.username=root
spring.datasource.secondary.password=root
spring.datasource.secondary.driver-class=com.mysql.cj.jdbc.Driver
改为:
spring.datasource.primary.jdbc-url=jdbc:mysql://localhost:3306/study?useUnicode=true&characterEncoding=utf-8&useSSL=true
spring.datasource.primary.username=root
spring.datasource.primary.password=root
spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.secondary.jdbc-url=jdbc:mysql://localhost:3306/study?useUnicode=true&characterEncoding=utf-8&useSSL=true
spring.datasource.secondary.username=root
spring.datasource.secondary.password=root
spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url 数据库的 JDBC URL。
spring.datasource.jdbc-url 用来重写自定义连接池
官方文档的解释是:
因为连接池的实际类型没有被公开,所以在您的自定义数据源的元数据中没有生成密钥,而且在IDE中没有完成(因为DataSource接口没有暴露属性)。另外,如果您碰巧在类路径上有Hikari,那么这个基本设置就不起作用了,因为Hikari没有url属性(但是确实有一个jdbcUrl属性)。在这种情况下,您必须重写您的配置如下:
相关文章
- What is garbage collection in C#?
- Is it possible to get a good stack trace with .NET async methods?
- 报错(未解决):Offset commit failed on partition xxx at offset 957: The coordinator is not aware of this member.
- distribution was not found and is required by the application错误
- pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail
- Git Error: fatal: Cannot setup tracking information; starting point 'origin/bb' is not a branch.
- Hbase报错:org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet
- MRTG Monitoring with ESXi Hosted Guest Return ‘interface is commented * has no ifSpeed property’
- 解决bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
- 【AGC】【认证服务】认证服务集成第三方登录后返回third provider is disabled,错误码203817988
- this is incompatible with sql_mode=only_full_group_by
- android studio This client is too old to work with the working copy at
- And one thing may differ I found is that, it only compatible with python3,so when your default pip installed in python is 2.7 not python3 you need use "python3 -m pip install chefboost" instead
- Microsoft SQL Server 17导出xlsx文件时报错:The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. (System.Data)
- 安卓开发 报错 错误:This version of android studio is incompatible with the gradle version used. 的解决
- 【Gym 100712A】Who Is The Winner?
- Node Sass version 5.0.0 is incompatible with^4.0.0
- [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform
- Open quote is expected for attribute "{1}" associated with an element type "name".
- haproxy 503 service unavailable no server is avaible to handle this request
- Error:Node Sass version 5.0.0 is incompatible with ^4.0.0 问题解决
- 使用paddle RuntimeError: CUDA error: no kernel image is available for execution on the device解决方法
- nested exception is java.lang.NoClassDefFoundError: com/taotao/pojo/TbContentExample$Criteria] with