Spring @Transactional事务失效

问题代码 service方法抛出了异常,但是没有rollback @Transactional public void batchInsert() throws CommonException{} 抛出的自定义异常继承于Exception public class CommonException extends Exception{} 问题原因 @Tra

quartz cron表达式详解

Cron表达式是一个字符串,字符串以5或6个空格隔开,分为6或7个域,每一个域代表一个含义,Cron有如下两种语法格式: (1) Seconds Minutes Hours DayofMonth Month DayofWeek Year

Java中的随机数生成API

ThreadLocalRandom Java 1.7或者之后的版本 import java.util.concurrent.ThreadLocalRandom; // nextInt is normally exclusive of the top value, // so add 1 to make it inclusive int randomNum = ThreadLocalRandom.current().nextInt(min, max + 1); ThreadLocalRandom API Random Java 1.7之前 import java.util.Random; /** * Returns a pseudo-random number between min and max, inclusive. * The difference between min and max can be at

Windows IP DNS批处理

指定ip信息,只需要修改set参数 name是控制面板\网络和 Internet\网络连接中对应的连接名称 @echo off set name="Wi-Fi" set ipaddress=172.16.61.216 set mask=255.255.255.0 set gateway=172.16.61.254 set dns1=172.16.3.38 set dns2=172.16.3.41 netsh interface ip set address