【异常记录】数据源读不到url

 

报错信息:

 

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine suitable jdbc url


Action:

Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).


Process finished with exit code 1

数据源配置:

    # sqlserver
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    jdbc-url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=his    错误!!! jdbc-url改成url
    username: sa
    password: 123qaz
    dbType: sqlserver

 

写错了,是url不是jdbc-url,多数据源才有此写法;

  datasource:
    primary:
      driver-class-name: com.mysql.jdbc.Driver
      jdbc-url: jdbc:mysql://XXX
      username: xxx
      password: xxx
      dbType: mysql
    secondary:
      driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
      jdbc-url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=xxx
      username: sa
      password: 123456
#      dbType: sqlserver
    thirdly:
      driver-class-name: com.mysql.jdbc.Driver
      jdbc-url: jdbc:mysql://ZZZ
    username: zzz
      password: zzz
      type: com.alibaba.druid.pool.DruidDataSource
      driverClassName: com.mysql.jdbc.Driver

 

posted @ 2021-04-17 22:07  加瓦加瓦  阅读(1213)  评论(0编辑  收藏  举报