SpringBoot连接PgSQL

SpringBoot连接PgSQL

  1. 准备一个测试用的SpringBoot项目

  2. 添加依赖,降如下图的依赖添加进去

  3. 配置application.yml文件,下图中,username是你自己的数据库的用户名,password是你自己的密码

  4. 编写一个db

  5. 写一个result

  6. 将所有的架构搭好之后,写一下Mapper,查询从那个表中查,我是demo表做测试用的。

  7. 之后在Impl里面调用并返回就可以了

  8. 这样就非常简单的连接上了PgSQL。

相关推荐
她说..1 天前
Spring AOP场景2——数据脱敏(附带源码)
java·开发语言·java-ee·springboot·spring aop
邂逅星河浪漫2 天前
【Dify-Chatflow】简历优化助手实现+前后端分离式系统集成+Docker容器化部署)
java·docker·vue·springboot·dify·apifox
期待のcode3 天前
MyBatis-Plus通用Service
java·后端·mybatis·springboot
biyeyuanma3 天前
Windows 10 环境下使用 GraalVM JDK 21 + Spring Boot 3.5 构建 Native Image
springboot
武哥聊编程3 天前
基于Springboot3+Vue3的仓库管理系统,经典项目,免费学习
java·学习·mysql·vue·springboot·课程设计
言一木3 天前
mybatis-plus分表实现案例
springboot·mybatis-plus·水平分表
fanruitian4 天前
springboot4 swagger3
java·springboot·swagger3·springboot4
wxh_无香花自开4 天前
pgsql 笔记
linux·服务器·postgresql·pgsql
千寻技术帮4 天前
10407_基于springboot的就业信息分享系统
mysql·毕业设计·源码·springboot·安装·文档·就业信息