共计 46 篇文章

下划线驼峰命名互转

public class NameUtils { private static Pattern linePattern = Pattern.compile("_(\\w)"); /** 下划线转驼峰 */ public static String lineToHump(String str) { str = str.toLowerCase(); Matcher matcher = linePattern.matcher( ...

druid connection holder is null 错误记录

场景 springboot 使用的是druid连接池 执行原生sql 直接注入了EntityManager 调用 createNativeQuery方法执行sql 问题 出现异常: Caused by: java.sql.SQLException: connection holder is null at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection. ...

java ThreadPoolExecutor 的使用和拒绝策略

ThreadPoolExecuor的构造方法 先来看一下ThreadPoolExecuor类的构造方法 public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, RejectedExecutionHandler handler) { this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, Executors.defaultThreadFactory(), handler); } 参数说明: ...