<name>maxActive</name>
    <value>40</value>
  </parameter>
  <parameter>
    <name>maxIdle</name>
    <value>5</value>
  </parameter>
  <parameter>
    <name>maxWait</name>
    <value>-1</value>

解决方案 »

  1.   

    在close之前先判断一下是否已经关闭了,如果没有关闭再去close
      

  2.   

    if(result!=null) result.close();
    if(stmt!=null) stmt.close();
    if(conn!=null) conn.close();
    我这个方法就判断了
      

  3.   

    if(result!=null) result.close();
    if(stmt!=null) stmt.close();
    if(conn!=null && !conn.isClosed()) conn.close();
      

  4.   

    怕是楼主的池子实现有问题!
    错误信息:
    login error:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Object has been closed.楼主给的代码:
    System.out.println(e);
    System.out.println("NsrcxDBAccess.login error: no data");显然异常不是在楼主给的代码那里抛出来的.
    很可能是两个线程共享了一个Connection对象,当一个线程关闭了这个连接对象而另一个线程试图对这个连接执行sql操作的时候抛出了这个异常.
    可能楼主的池设计有问题, 能否把cb的代码贴出来我帮你看看?
      

  5.   

    if (st != null) { st.close();}
    if (rs != null) { rs.close();}
    if (con != null) {
    try {
         con.close();
    } catch (SQLException e) {
         System.out.println(e);
    }
             }
      

  6.   

    这个问题我遇到过不知道解决没有:
    A ResultSet object is automatically closed when the Statement object that generated it is closed, re-executed, or used to retrieve the next result from a sequence of multiple results. 就是说一个Statement如果被close了,或者另做查询什么的,以前做的ResultSet就会自动被关掉。所以要重新声明statement.
      

  7.   

    if(conn!=null) conn.close();
    不应该关闭,应该把它存入cb的一个连接对象数组 ,用完在jsp页面中释放
      

  8.   

    同意楼上--
    执行一次后-在JSP里CLOSE();
      

  9.   

    这个问题我遇到过不知道解决没有:
    A ResultSet object is automatically closed when the Statement object that generated it is closed, re-executed, or used to retrieve the next result from a sequence of multiple results. 就是说一个Statement如果被close了,或者另做查询什么的,以前做的ResultSet就会自动被关掉。所以要重新声明statement.支持一下