你这段代码硬伤太多public conndb()//导入驱动,你每刷新一次,就会重新建立一个连接池,因为你的
jsp代码:conndb conndb=new conndb();刷新十次,就建立了十个连接池(注意建立的不是十个连接),这个可能和你tomcat的
web.xml配置有关吧,好好想想,代码重新写过吧
jsp代码:conndb conndb=new conndb();刷新十次,就建立了十个连接池(注意建立的不是十个连接),这个可能和你tomcat的
web.xml配置有关吧,好好想想,代码重新写过吧
可我每次都conndb.closeconn();了,
我的web.xml如下
<resource-ref>
<description>SqlServer Datasource example</description>
<res-ref-name>jdbc/SqlServerDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
应该怎么解决;
2. 你tomcat 的配置一下最大连接数目
dbcp could not obtain an idle db connection ,pool exhausted
那应该怎么用 请多多指教.
大家有写好连接池吗能给我发一个吗?mail:[email protected]