如前面的文章所述,controller中抛出的异常我们使用ControllerAdvice来处理: @RestControllerAdvice @Slf4j public class GlobalExceptionHandler { @ExceptionHandler(value = Exception.class) public AjaxResponse handler(Exception e){ AjaxResponse r = new AjaxResponse(); if (e insta
无参数无返回类型方法语法格式: public static void 方法名称(){ 方法体; } class Method03{ /*练习3:输出1-100中的每个数,要求使用无参无返回类型的方法完成 无参数无返回类型 语法格式: public static void 方法名称(){ 方法体 } */ public static void print(){ for(int i = 1; i <= 100; i++){ System.out.println(i); } } } class Met
介绍: a . Fork/Join为JKD1.7引入,适用于对大量数据进行拆分成多个小任务进行计算的框架,最后把所有小任务的结果汇总合并得到最终的结果 b . 相关类 public abstract class RecursiveTask<V> extends ForkJoinTask<V>; public abstract class RecursiveAction extends ForkJoinTask<Void>; c . 其中RecursiveTask在执行有
spring jdbcTemplate query 返回值为null 今天使用以下方法从数据库中查询数据,返回列表 public List<BookBean> getBooks(){ String sql = "select * from books where inventory > 0 order by title"; List<BookBean> books = jdbcTemplate.query(sql, new BeanPropertyRowM
Spring Boot 集成教程 Spring Boot 介绍 Spring Boot 开发环境搭建(Eclipse) Spring Boot Hello World (restful接口)例子 spring boot 连接Mysql spring boot配置druid连接池连接mysql spring boot集成mybatis(1) spring boot集成mybatis(2) – 使用pagehelper实现分页 spring boot集成mybatis(3) – mybatis ge