有方法抛出了异常 没有捕获,比如下边的语句就会出现这个错误: if(this.conn!=null && !this.conn.isClosed()){//避免NullPointerException try{ this.conn.close();//关闭数据库 }catch(Exception e){ e.printStackTrace(); } } 改为下边这样就正常了 if(this.conn!=null){//避免NullPointerException try{ if(!this.conn.isClosed()) this.conn.close();//关闭数据库 }catch(Exception e){ e.printStackTrace(); } } |
|