当前位置:   article > 正文

SpringBoot+spring-date-jpa+Hibernate 整合mysql 与sqlserver 配置文件信息_springboot配置springdatajpa

springboot配置springdatajpa

SpringBoot+spring-date-jpa+Hibernate 整合mysql  配置文件


#mysql configure
spring.datasource.url = jdbc:mysql://localhost:3306/popularfeelings?serverTimezone=GMT&characterEncoding=utf-8
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
spring.jpa.database = MYSQL
#stripped before adding them to the entity manager
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

# Show or not log for each sql query

spring.jpa.show-sql = true

# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy


SpringBoot+spring-date-jpa+Hibernate 整合sqlserver配置文件


#sqlserver configure
spring.datasource.url = jdbc:sqlserver://localhost:1433;DatabaseName=test1
spring.datasource.username = sa
spring.datasource.password = sa
spring.datasource.driverClassName = com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.jpa.database = SQLSERVER
spring.jpa.properties.hibernate.default_schema = dbo

#test1代表数据库名称
spring.jpa.properties.hibernate.default_catalog= test1

#设置hibernate方言
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.SQLServer2008Dialect

# Show or not log for each sql query
spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/815243
推荐阅读
相关标签
  

闽ICP备14008679号