日期:2014-05-20 浏览次数:20611 次
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();} }