美文网首页
[spring-data-jpa]快速配置

[spring-data-jpa]快速配置

作者: 小贾同学coding | 来源:发表于2020-03-14 17:59 被阅读0次

ReadMe

 1.maven依赖

  <!--        springboot下maven依赖-->
     <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
     </dependency>

 2.数据源配置

spring:
  datasource:
#    驱动名
    driver-class-name: com.mysql.cj.jdbc.Driver
#    数据库地址
    url:
#    用户名
    username: 
#    密码
    password: 
  jpa:
# 显示执行的sql
    show-sql: true
    hibernate:
# 设置每次重启项目后为更新操作
      ddl-auto: update

返回目录

相关文章

网友评论

      本文标题:[spring-data-jpa]快速配置

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