09 2022 档案
摘要:配置mybatis mybatis: #mapper路径 mapper-locations: classpath:mapper/*.xml configuration: #日志输出 log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启驼峰
阅读全文
摘要:#开启logging logging.level.org.springframework.boot.autoconfigure: error logging: level: main.blog.mapper: debug config: classpath: logback-spring.xml
阅读全文
摘要:1. POI Apache POI 是基于 Office Open XML 标准(OOXML)和 Microsoft 的 OLE 2 复合文档格式(OLE2)处理各种文件格式的开源项目。 2. 样式设置 //设置标题 HSSFCellStyle titleStyle = workbook.creat
阅读全文
摘要:1.MinIO简介 MinIO是高性能的对象存储,单个对象最大可达5TB。适合存储图片、视频、文档、备份数据、安装包等一系列文件。是一款主要采用Golang语言实现发开的高性能、分布式的对象存储系统。客户端支持Java,Net,Python,Javacript, Golang语言。客户端与服务器之间
阅读全文
摘要:<?xml version="1.0" encoding="UTF-8"?> <configuration scan="true"> <contextName>auth</contextName> <property name="LOG_APP_NAME" value="${LOG_APP_NAME
阅读全文
摘要:mysql查询时候报错: Lock wait timeout exceeded; try restarting transaction 译文:锁等待超时;试着重新启动事务 被锁了,需要解锁。 1.innodb_trx 当前运行的所有事务 select * from information_schem
阅读全文
摘要:1.静态加载Driver static { try { Class.forName("com.mysql.cj.jdbc.Driver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } } 2.创建连接 private st
阅读全文
摘要:1.错误信息 org.redisson.client.RedisException: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands t
阅读全文
摘要:进入my.cnf文件//乱码修改 设置编码 character_set_server = utf8mb4 //编码 collation-server = utf8mb4_general_ci //连接数据库执行操作 init_connect='SET NAMES utf8mb4' 1.只有在普通用户
阅读全文
摘要:1. nginx启动报错: Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -x
阅读全文
摘要:public static <K, V> Map<K, V> parseListToMap(Collection<V> list, Function<V, K> mapper) { if (list == null || list.size() == 0) { return null; } Map<
阅读全文
摘要:1.自动装配组件@Autowired和@Resource @Autowired @Autowired 注解属于spring注解 默认为 @Autowired(required=true), required为true表示注入bean的时候,该bean必须存在,否则就会注入失败报错。 为false表示
阅读全文
摘要:1.@Conditional注解 @Conditional 是Spring4新提供的注解。 它的作用是按照一定的条件进行判断,满足条件给容器注册bean,否则不注入。 可以作用在方法上,也可以作用在类上。 使用的时候需要传入实现Condition接口类数组。 如果是类和方法都加了@Condition
阅读全文
摘要:1.如果改子类有父类,则把父类加入子类的父ID中 private static List<MentVo> breadthParentFirst(List<MentVo> rootTree) { if (CollectionUtils.isEmpty(rootTree)) { return Lists
阅读全文
摘要:MySql执行分组sql报错: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'db.tir1.display_name' which is not functiona
阅读全文
摘要:根据意思可以看出 mysql执行的报文过大。需要我们设置允许的最大报文max_allowed_packet; org.springframework.dao.TransientDataAccessResourceException: ### Error querying database. Caus
阅读全文
摘要:/** * MD5加密 * @param message 要进行MD5加密的字符串 * @return 加密结果为32位字符串 */ private static String getMD5(String message) { MessageDigest messageDigest = null;
阅读全文
摘要:1.随机生成密钥对 /** * 随机生成密钥对 * @throws NoSuchAlgorithmException */ public static void genKeyPair() throws NoSuchAlgorithmException { // KeyPairGenerator类用于
阅读全文
摘要:java根据系统参数生成每个计算机的唯一标识。 1. 获取CPU序列号 /** * 获取CPU序列号 * @return * @throws IOException */ public static String getCPUSerialNumber() { String next; try { P
阅读全文
摘要:Builder 模式也叫建造者模式,builder模式的作用将一个复杂对象的构建与他的表示分离,一步一步创建一个复杂对象的创建型模式。在不知道内部建造细节的情况下,可以更精细的控制对象的构造流程。目的就是为了解耦。 public class UserInfo { private String nam
阅读全文
摘要:一、Lambda表达式 1. Lambda使用条件 Lambda表达式是 JDK8 的一个新特性,可以认为是对匿名内部类的一种简化,但不是所有的匿名内部类都可以简化为Lambda表达式。 只有函数式接口的匿名内部类才可以使用Lambda表达式来进行简化。 实现函数式接口注解 @FunctionalI
阅读全文
摘要:java技术文档 1. 四大基本函数式接口 Predicate 判定型接口 //是否相等 Predicate<Object> equal = Predicate.isEqual(""); Predicate<String> predicate = str -> str.equals("7"); //
阅读全文
浙公网安备 33010602011771号