Struts DataSource

yyy851124 2009-01-13 10:39:05
我用strutsdatasource连接的as400数据库。 每次刷新10次左右就卡在 con=ds.getConnection() 或 con.preparedStatement(“select max(sn) from **”);不动了。 strutsdatasource设置的最大连接是50 。最小10.
...全文
50 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yyy851124 2009-01-14
  • 打赏
  • 举报
回复
public int getBigSn(DataSource ds){
System.out.println("ds "+ds);
try {
int i = 0 ;
con = ds.getConnection();
System.out.println("con "+con);
ps = con.prepareStatement("select max(sn) from docupgm.WEBBLFB");
System.out.println("ps "+ps);
rs = ps.executeQuery();
if(rs.next()){
i = rs.getInt(1);
}
return i ;
} catch (SQLException e) {
e.printStackTrace();
System.out.println("getBigSn方法异常");
}
finally{
this.close();
}
return 0;
}
yyy851124 2009-01-13
  • 打赏
  • 举报
回复
用完就全部关闭了,这个还是知道的
jsf_jsp 2009-01-13
  • 打赏
  • 举报
回复
没关闭可能不太确切,应该说是没有还连接,因为这里用的是数据源连接池
Landor2004 2009-01-13
  • 打赏
  • 举报
回复
可能是没有关闭连接
看后台的提示,应该很清楚!
jsf_jsp 2009-01-13
  • 打赏
  • 举报
回复
没有关闭连接吧

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧