Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
JDBC 数据源是jdbc-url,这里配置了多数据源,即分布式事务处理。
spring:
datasource:
primary:
jdbc-url: jdbc:mysql://localhost:3306/mybook?useUnicode=true&characterEncoding=utf-8
username: root
password: ENC(BHwwNZhfnSS9QLRiWYLuMw==)
driver-class-name: com.mysql.cj.jdbc.Driver文章来源:https://www.toymoban.com/news/detail-447202.html
JPA数据源是url
spring:
datasource:
url: jdbc:mysql://localhost:3306/mybook?useUnicode=true&characterEncoding=utf-8
username: root
password: ENC(BHwwNZhfnSS9QLRiWYLuMw==)
driver-class-name: com.mysql.cj.jdbc.Driver
文章来源地址https://www.toymoban.com/news/detail-447202.html
到了这里,关于JDBC和JPA 数据源JDBC-URL和URL注意事项的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!