就代码上看:
con=DriverManager.getConnection("jdbc:odbc:peo");
在构造方法中,而它的关闭却在另一个方法isExistUser中,
是不是有点问题呢?

解决方案 »

  1.   

    可能是先关了statement的缘故吧
      

  2.   

    请问con在哪里关闭比较好?我去掉con.close()还是有错,去掉rs.close()就没问题了 难道是rs是提前自动关闭的?
      

  3.   

    //rs.close();
    有時這樣就可以解決了。
      

  4.   

    把Resultset和PreparedStatement关闭顺序换一下
    关闭PreparedStatement和Connection的时候,会自动关闭Resultset