1--首先打开pgsql的服务:
2--DBeaver中建立表:
3--mysql与SpringBoot连接池设计:
#mysql数据库连接
#spring.datasource.url=jdbc:mysql://localhost:3306/redis01?useUnicode=true&characterEncoding=utf-8&useSSL=false
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.username=root
#spring.datasource.password=123456
相关依赖连接:
<!--mysql JDBC驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
4--pgsql与SpringBoot连接池设计连接:
#pgsql数据库连接
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.url=jdbc:postgresql://localhost:5432/redis?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.username=postgres
spring.datasource.password=123456
相关依赖设计连接:
<!--连接pgsql-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>