首页 > 数据库 >idea中配置本地postgresql数据源

idea中配置本地postgresql数据源

时间:2022-11-07 14:58:26浏览次数:43  
标签:postgresql spring 数据库 idea datasource 数据源

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=数据库密码

 

标签:postgresql,spring,数据库,idea,datasource,数据源
From: https://www.cnblogs.com/lilyshy/p/16865921.html

相关文章