1、Cannot get a connection, pool exhausted (耗尽)
连接池资源耗尽
原因:在做SISP系统时,进行批量导入操作(导入50万条以上的记录),从文件中读取指定的行数,在一次性进行
批量插入后,没有关闭链接,释放资源,结果出现该异常。但是在批量导入一万条数据时却没有报错!
解决:加入关闭链接,比如:
if
(pstmt
!=
null
){
pstmt.close();
pstmt = null ;
}
if (conn != null ){
conn.close();
conn = null ;
}
pstmt.close();
pstmt = null ;
}
if (conn != null ){
conn.close();
conn = null ;
}