pom.xml文件中新增
<!--postgresql数据库配置--> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>42.2.18</version> 版本号 <scope>runtime</scope> </dependency> application.properties文件中新增
#postgresql数据源配置 spring.datasource.driver-class-name=org.postgresql.Driver spring.datasource.url=jdbc:postgresql://localhost:端口号/数据库?serverTimeZone=UTC spring.datasource.username=数据库用户 spring.datasource.password=数据库密码