上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页
摘要: 1.增 1.1.dao层接口 public interface UserDao { ... /*插入记录*/ int intsertUser(User user); ... } 1.2.绑定的mapper.xml <!--插入语句--> <insert id="intsertUser" parame 阅读全文
posted @ 2022-05-13 19:36 努力的达子 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 学习网址:https://mybatis.org/mybatis-3/zh/index.html 1.MyBatis 是一款优秀的持久层框架,它支持自定义 SQL、存储过程以及高级映射。 2.MyBatis 免除了几乎所有的 JDBC 代码以及设置参数和获取结果集的工作。 3.MyBatis 可以通 阅读全文
posted @ 2022-05-13 19:32 努力的达子 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 如果现有的strter无法满足自己目前的需求,可以自定starter 实现步骤: 1.创建两个项目 1.1创建一个maven项目(相当于面子:里面引入1.2的依赖) 1.2用springboot的快速向导创建一个sprinboot的项目(相当于里子) 目的:maven项目引入1.2的依赖,其他模块引 阅读全文
posted @ 2022-05-11 22:40 努力的达子 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 1.profile功能(多配置文件功能,可以决定使用哪个配置文件) 这里需要注意的是: 1.起作用的配置有两个: 1.默认的配置文件application.properties 2.自定义的配置文件application-pro.yml(前缀必须是application) 并且是两个配置文件共同起作 阅读全文
posted @ 2022-05-11 22:38 努力的达子 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 1.springboot Actuator 简介: 未来每个微服务在云上部署以后,我们都会对其进行监控、追踪、审计、控制等。springboot就抽取了Actuator场景,使得每个微服务能快速的引用即可获得生产级别的应用监控 简单实用步骤: 1.引入依赖: <!--引入监控功能--> <depen 阅读全文
posted @ 2022-05-11 22:36 努力的达子 阅读(120) 评论(0) 推荐(0) 编辑
摘要: springboot2.2.0版本开始引入junit5作为单元测试默认库 junit5的常用注解:参考地址:https://junit.org/junit5/docs/current/user-guide/ 1.@Display:为测试类或者测试方法设置展示名称 public class Sprin 阅读全文
posted @ 2022-05-11 22:25 努力的达子 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1.引入redis的stater依赖 <!--引入redis的stater--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifact 阅读全文
posted @ 2022-05-11 22:21 努力的达子 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 步骤: 1.引入mybatis的stater <!--导入mybatis的stater依赖--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</arti 阅读全文
posted @ 2022-05-11 22:20 努力的达子 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1.jdbc 快速建立springboot项目时,在sql场景里选择mysql和spring data jdbc pom文件中: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-star 阅读全文
posted @ 2022-05-11 22:16 努力的达子 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 用法:使用模板引擎进行处理 在templates新增error文件夹如图: 定制错误解析逻辑 一:第一种方式:(@ControllerAdvice和@ExceptionHandler处理全局异常;底层是ExceptionHandlerExceptionResource支持的) 重点1:@Contro 阅读全文
posted @ 2022-05-11 22:07 努力的达子 阅读(58) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页