ResultSet 被closed
来源:互联网 发布:期货分析考试软件 编辑:程序博客网 时间:2024/06/02 22:26
在执行executeQuery之后,然后关闭连接池,此时ResultSet也会关闭(可能跟垃圾回收有关吧)
之前是用一个统一的方法执行select 语句
public static ResultSet exeQuerySql(String strSql) throws SQLException
{
Connection conn=null;
ResultSet rs=null;
PreparedStatement st=null;
try {
conn =DBUnitl.open();
st=conn.prepareStatement(strSql);
rs= st.executeQuery();
return rs;
} catch (Exception e) {
e.printStackTrace();
return rs;
}
finally
{
DBUnitl.release(conn,st, null);//释放链接、关闭线程池
}
}
,然而,在之后使用返回的ResultSet时,提示ResultSet被关闭了,无奈被迫不在使用统一的sql语句执行方法,改为在每一个daoimpl里执行conn、rs、st,在程序的最后释放链接、关闭连接池。
0 0
- ResultSet 被closed
- ResultSet is closed!
- ResultSet is closed
- 错误:Operation not allowed after ResultSet closed
- Operation not allowed after ResultSet closed
- SQLException: Operation not allowed after ResultSet closed
- Operation not allowed after ResultSet closed
- java.sql.SQLException: ResultSet is closed解决方法
- Operation not allowed after ResultSet closed
- Operation not allowed after ResultSet closed
- 错误:Operation not allowed after ResultSet closed
- Operation not allowed after ResultSet closed 解决方案
- Operation not allowed after ResultSet closed
- Operation not allowed after ResultSet closed
- Operation not allowed after ResultSet closed--Mysql
- Operation not allowed after ResultSet closed
- Operation not allowed after ResultSet closed
- Operation not allowed after ResultSet closed 解决方法
- Effective OC : 1-5
- 兔子--android.view.windowmanager BadTokenException :unable to add window token null is not for applica
- AWK命令详解
- js中return的用法
- struct和typedef
- ResultSet 被closed
- 请求乱码 一台机器行,另外一台不行
- Spring MVC 学习 之 - URL参数传递
- 修改cas-server(三),自定义登录验证方式。
- Windows下Core Audio APIS 音频应用开发(一)
- 如何将Word图片转换成PDF文档
- 数据库Sharding的基本思想和切分策略
- 线段树HDU——1754(单点替换,区间最值)
- 记一hiredis redisCommand坑