| 发表于:2007-08-08 10:45:0810楼 得分:0 |
private vector checkconnection(string chknap,string chktable){ connection con; vector result = new vector(); dbcon dbcon = new dbcon(); try { con = dbcon.getconnection(); preparedstatement pstmt=con.preparestatement( "select ? from ?; "); pstmt.setstring(1, chknap); pstmt.setstring(2, chktable); resultset rs=pstmt.EXECutequery(); while(rs.next()){ result.addelement(rs.getstring(1).tostring()); } }catch (sqlexception e) { system.out.println(e.tostring()); } return (result); } | | |
|