(一)springboot中测试的基础知识 (1)添加starter-test依赖,范围指定为test,只在执行测试时生效 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter ...
分类:
编程语言 时间:
2019-12-14 21:05:37
阅读次数:
82
1.引入依赖 <!--springboot的web起步依赖--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency> ...
分类:
编程语言 时间:
2019-12-14 20:59:05
阅读次数:
95
SpringBoot集成Quartz动态定时任务 项目中需要用到定时任务,考虑了下java方面定时任务无非就三种: 1. 用Java自带的timer类。稍微看了一下,可以实现大部分的指定频率的任务的调度(timer.schedule()),也可以实现关闭和开启(timer.cancle)。但是用其来 ...
分类:
编程语言 时间:
2019-12-14 20:56:02
阅读次数:
97
1.如何定时任务 1.1 开启定时任务 @EnableScheduling //开启定时任务 @SpringBootApplication public class ManagerApplication { private static Logger logger = LoggerFactory.g ...
分类:
编程语言 时间:
2019-12-14 20:54:14
阅读次数:
87
一、JDBCTemplate 1、导入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <!-- ht ...
分类:
数据库 时间:
2019-12-14 19:20:41
阅读次数:
85
1.Spring 整合 Mybatis-Plus a.链接:https://www.cnblogs.com/vettel0329/p/11990721.html 2.后端搭建: a.在数据库创建 tb_user 用户表 b.创建SpringBoot工程,选择依赖 Web、Thymeleaf、Mysq ...
分类:
编程语言 时间:
2019-12-14 19:03:36
阅读次数:
86
原文作者:CHEN川 原文地址:http://www.jianshu.com/p/83693d3d0a65 预警:本文非常长,建议先mark后看,也许是最后一次写这么长的文章 说明:前面有4个小节关于Spring的基础知识,分别是:IOC容器、JavaConfig、事件监听、SpringFactor ...
分类:
编程语言 时间:
2019-12-14 18:59:13
阅读次数:
127
步骤 创建xxxAutoConfiguration类 添加@Configuration注解修饰 添加@Conditionalxxx注解做注入条件判断 添加@AutoConfigureOrder注解注入顺序 添加@AutoConfigureAfter注解注入后操作 创建xxxProperties配置类 ...
分类:
编程语言 时间:
2019-12-14 18:58:51
阅读次数:
96
引入依赖架包 <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc --> <dependency> <groupId>org.springframework.boot</g ...
分类:
数据库 时间:
2019-12-14 18:58:22
阅读次数:
117
Springboot JdbcTemplate JdbcTemplate是Spring框架自带的对JDBC操作的封装,目的是提供统一的模板方法使对数据库的操作更加方便、友好,效率也不错。 整合使用JdbcTemplate实现对图书的添加功能小案例 采用springboot2.0.0版本 导入所需依赖 ...
分类:
数据库 时间:
2019-12-14 17:38:32
阅读次数:
120