Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java EE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 resin下数据库lock为什么不能释放?
woodworm





发贴: 80
积分: 1
于 2003-08-05 13:46 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
小弟在resin下作jsp。经常用着用着就速度特别慢,不知道什么原因。不过我发现数据库在访问后被lock了。但是有时即使关掉resin也不能释放。

请问谁知道什么原因?
下面是我得数据库连接得代码:特别是用executeQuery1,带参数得连接数据库后,根本不会释放.请问各位得情况如何?
public ResultSet executeQuery(String sql){
rs=null;
try{
conn=DriverManager.getConnection(sConnStr);
Statement stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
}catch(SQLException ex){
System.err.println("aq.executeQuery: "+ex.getMessage());
}

return rs;
}
public ResultSet executeQuery1(String sql){
rs=null;
try{
conn=DriverManager.getConnection(sConnStr);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs=stmt.executeQuery(sql);
}catch(SQLException ex){
System.err.println("aq.executeQuery: "+ex.getMessage());
}

return rs;
}
public void clearConn(){
if (conn!=null) {
try {
if (conn != null)
conn.close();
conn=null;
} catch (SQLException e) {
e.printStackTrace();
}

}
}




话题树型展开
人气 标题 作者 字数 发贴时间
6689 resin下数据库lock为什么不能释放? woodworm 923 2003-08-05 13:46
5300 Re:resin下数据库lock为什么不能释放? 256456 162 2003-08-06 09:50
5603 Re:resin下数据库lock为什么不能释放? woodworm 107 2003-08-07 23:07
4981 Re:resin下数据库lock为什么不能释放? fredfred 1610 2003-08-18 08:26

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923