- 博客(3)
- 资源 (1)
- 收藏
- 关注
原创 hutool获取指定时间段内每一天的日期
Date startDate = DateUtil.beginOfDay(DateUtil.lastWeek());Date endDate = DateUtil.endOfDay(DateUtil.yesterday());List<DateTime> dateList = DateUtil.rangeToList(startDate, endDate, DateField.DAY_OF_YEAR);for (Date dt : dateList) { System.out.p
2023-05-09 16:20:33 721 1
翻译 spring 线程异步执行
多线程并发处理起来通常比较麻烦,如果你使用spring容器来管理业务bean,事情就好办了多了。spring封装了Java的多线程的实现,你只需要关注于并发事物的流程以及一些并发负载量等特性,具体来说如何使用spring来处理并发事务:1.了解 TaskExecutor接口Spring的TaskExecutor接口等同于java.util.concurrent.Executor接口。 实际上,它存在的主要原因是为了在使用线程池的时候,将对Java5的依赖抽象出来。 这个接口只有一个方法exec.
2021-11-04 17:29:31 1062
翻译 java 实现mysql数据库备份,以及 Runtime.getRuntime().exec 阻塞解
public String executionCommand(String command) throws Exception { String msg = ""; Process process try { process = Runtime.getRuntime().exec(["bash", "-c",command] as String[]); InputStream is1 = process.getInputStream(); .
2021-11-04 15:58:57 352
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人