第一步:添加springboot-data-jpa和数据库的依赖关系
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
第二步:编写propertiys文件或者yml文件的配置
application.properties:
spring.datasource.driver-class-name=com.mysql.jdbc.Driver