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线程池如何关闭

try { executorService.shutdown(); while (!executorService.awaitTermination(1, TimeUnit.SECONDS)){ Thread.sleep(1000); } log.info("所有线程均已结束"); } catch (InterruptedException e) { e.printStackTrace(); } ...