美文网首页
Spring boot JPA单数据源配置

Spring boot JPA单数据源配置

作者: mua_baby | 来源:发表于2021-01-17 17:23 被阅读0次

随便记录一下

环境配置

Spring boot (v2.4.1)
Spring Data JPA 2.4.1

application.yml

spring:
  datasource:

    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    username: myusername
    password: mypassword
    url: jdbc:sqlserver://localhost:1433;DatabaseName=MyDatabaseName;charset=UTF-8
  jpa:
    show-sql: true
    properties:
      hibernate:
        format_sql: true
    hibernate:
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      ddl-auto: validate
server:
  port: 8181
  tomcat:
    uri-encoding: utf-8

相关文章

网友评论

      本文标题:Spring boot JPA单数据源配置

      本文链接:https://www.haomeiwen.com/subject/ufxzaktx.html