zoukankan      html  css  js  c++  java
  • jdbcUrl is required with driverClassName错误解决

              jdbcUrl is required with driverClassName


    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属性)。在这种情况下,您必须重写您的配置如下:

    原文地址:https://blog.csdn.net/newbie_907486852/article/details/81391525
  • 相关阅读:
    OpenSSL SSL_connect: Connection was reset in connection to github.com:443 git访问不到
    vue 阻止页面跳转 , 询问是否离开页面 , 确定后离开, 禁用浏览器返回功能
    SpringBoot: No active profile set, falling back to default profiles: default , 不一定是依赖的问题
    intellij . 关闭重复波浪线提示 (IDEA)
    编码
    git搭建个人仓库
    请求路径中添加版本号
    java调用maven
    迁移学习
    Promise实现
  • 原文地址:https://www.cnblogs.com/jpfss/p/11083472.html
Copyright © 2011-2022 走看看