随笔分类 -  java常用工具类

SQL检测超时工具类
摘要:1.简述 这个工具类主要是为了防止sql卡死或执行时间过长所编写的,这样做可以减少数据库占用资源,是使用定时器进行检测的。下面的案例我就没写定时器了,只是写了检测方法。该方法可以根据需求自己进行修改。 2.实现 /**测试类 */ public class Test{ public static v 阅读全文

posted @ 2020-09-30 09:09 码农记录 阅读(274) 评论(0) 推荐(0)

简易Id切分工具类
摘要:public class SqlIdSplit { public SqlIdSplit(int minId,int maxId,int size){ this.maxId=maxId+1; this.size=size; this.ind=minId; } private int maxId;//最 阅读全文

posted @ 2020-09-24 10:07 码农记录 阅读(307) 评论(0) 推荐(0)

简易sql拼接工具类(使用StringBuilder实现)
摘要:/** * 简易sql拼接 * 注意不同重载方法的不同注释!!! */ public class SqlBuilder { /** 不要包含where */ public SqlBuilder(String sql){ this.sb = new StringBuilder(sql); } /** 阅读全文

posted @ 2020-09-23 19:44 码农记录 阅读(968) 评论(0) 推荐(0)

缓存工具类(使用ConcurrentMap集合实现)
摘要:public class Cache { static ConcurrentMap<String, Cache> datas = new ConcurrentHashMap<String, Cache>();//缓存集合 static long pMaxTime=1000*60*5;//最大缓存时间 阅读全文

posted @ 2020-09-23 19:14 码农记录 阅读(575) 评论(0) 推荐(0)

properties文档读取工具类
摘要:import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.uti 阅读全文

posted @ 2020-09-23 17:59 码农记录 阅读(125) 评论(0) 推荐(0)

时间工具类
摘要:import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Set; import jav 阅读全文

posted @ 2020-09-23 17:54 码农记录 阅读(123) 评论(0) 推荐(0)

Java分页、Json工具类
摘要:1.JSON数据转换工具类 import java.util.List; import java.util.Map; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.ref 阅读全文

posted @ 2020-09-23 17:27 码农记录 阅读(493) 评论(0) 推荐(0)

导航