1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Hibernate学习笔记:数据库连接的配置

Hibernate学习笔记:数据库连接的配置

时间:2024-02-09 14:17:54

相关推荐

Hibernate学习笔记:数据库连接的配置

SpringBoot连接mysql需要在application.properties添加一些微调信息,Spring自带连接池,如果用Spring自带的连接池:

spring.datasource.url=jdbc:mysql://localhost:3306/jelly?useSSL=false&characterEncoding=utf8

spring.datasource.username=tom

spring.datasource.password=123456

spring.datasource.driver-class-name=com.mysql.jdbc.Driver

然后配置Hibernate

# Specify the DBMSspring.jpa.database=MYSQL# Show or not log for each sql queryspring.jpa.show-sql=true# Hibernate ddl auto (create, create-drop, update)spring.jpa.hibernate.ddl-auto=update# Naming strategyspring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy# stripped before adding them to the entity manager)

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。