问题代码 service方法抛出了异常,但是没有rollback @Transactional public void batchInsert() throws CommonException{} 抛出的自定义异常继承于Exception public class CommonException extends Exception{} 问题原因 @Tra
Cron表达式是一个字符串,字符串以5或6个空格隔开,分为6或7个域,每一个域代表一个含义,Cron有如下两种语法格式: (1) Seconds Minutes Hours DayofMonth Month DayofWeek Year
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
第一种方法 <if test="userName != null && userName.trim().length !=0 " > 第二种方法 <if test="@org.apache.commons.StringUtils@isEmpty(userName)" >
指定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
需要注意在判断int和Integer是否相等时,会先将Integer拆箱,如果Integer为null,会报空指针异常。 因此需要提前处理好I
1. ASCII码 我们知道,在计算机内部,所有的信息最终都表示为一个二进制的字符串。每一个二进制位(bit)有0和1两种状态,因此八个二进制位就