摘要: 1、resources下建目录lib,lib下放jar包 2、pom文件加依赖 <dependency> <groupId>包名</groupId> <artifactId>k3cloud-webapi-sdk</artifactId> <version>8.0.4</version> <scope 阅读全文
posted @ 2023-03-13 16:48 天冷吃冰棍儿 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 前言 当两个人同时操作一条数据时会引起并发,这时候可以用synchronized锁住代码块,进行相关处理。 注:JPAUtil根据ID查询不是实时数据,可能里面有缓存。后改成DBTool 原生查询sql,才查出实时数据。 DBTool tool = new DBTool(); Record[] r 阅读全文
posted @ 2020-11-17 16:02 天冷吃冰棍儿 阅读(503) 评论(0) 推荐(0) 编辑
摘要: 1. @Transactional只能被应用到public方法上,对于其它非public的方法,如果标记了@Transactional也不会报错,但方法没有事务功能。 2. @Transactional引入包问题,她有两个包:import javax.transaction.Transactiona 阅读全文
posted @ 2020-11-17 13:21 天冷吃冰棍儿 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 前段时间发过此类demo,后经大神改版,学到了一点,遂记录一下 1 /** 2 * 利用线程池起两个任务 3 */ 4 public String thredSubmit(String uuidStr, List<VariationMapIn> mapIns, List<ApproveHis> hi 阅读全文
posted @ 2020-11-13 14:35 天冷吃冰棍儿 阅读(5814) 评论(0) 推荐(0) 编辑
摘要: 1、启动时执行任务CommandLineRunner CommandLineRunner是一个接口,只需实现该接口就行。如果存在多个类,需要按顺序加载的时候,我们也可以使用@Order注解来排序。 @Component @Order(value=1) public class StartupRunn 阅读全文
posted @ 2020-11-11 14:17 天冷吃冰棍儿 阅读(5377) 评论(0) 推荐(0) 编辑
摘要: package com.test; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorServ 阅读全文
posted @ 2020-11-09 17:18 天冷吃冰棍儿 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 1 public String test() { 2 String result = ""; 3 CountDownLatch rollBackLatch = new CountDownLatch(1); 4 CountDownLatch mainThreadLatch = new CountDow 阅读全文
posted @ 2020-11-09 17:13 天冷吃冰棍儿 阅读(7117) 评论(0) 推荐(2) 编辑
摘要: public static void main(String[] args) { String[] versions = { "1.9", "1.10", "1.0" }; for (int i = versions.length - 1; i > 0; i--) { for (int j = 0; 阅读全文
posted @ 2020-11-05 14:36 天冷吃冰棍儿 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 冒泡排序 1 public static void main(String[] args) { 2 // 定义数组 3 int data[] = new int[4]; 4 // 初始化数组 5 initData(data); 6 System.out.println(JSON.toJSONStri 阅读全文
posted @ 2020-10-21 10:42 天冷吃冰棍儿 阅读(75) 评论(0) 推荐(0) 编辑
摘要: package com.jredu.week; import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.File;import java.io.FileInputStream;impo 阅读全文
posted @ 2017-04-18 20:39 天冷吃冰棍儿 阅读(267) 评论(1) 推荐(0) 编辑