对于关闭连接等资源的问题
public ResultSet getRset(String sqlstr){ try { ct=this.getConn(); pm=ct.prepareStatement(sqlstr); rs=pm.executeQuery(); closeall(); } catch(Exception e) {e.printStackTrace();} finally { return rs; }}public void closeall(){ try{ if(this.rs!=null){rs.close();this.rs=null;} if(this.pm!=null){pm.close();this.pm=null;} if(this.ct!=null){ct.close();this.ct=null;}}catch(Exception e){e.printStackTrace();}}