public ArrayList getElement() throws Exception { Connection conn = ConnUtil.getConn(); PreparedStatement pstmt = conn.prepareStatement("select * from t_user where GID=? and UID=?"); pstmt.setString(1,"GID"); pstmt.setString(2,"UID"); ResultSet rs = pstmt.executeQuery(); if(rs.next()) { } }
我想把结果集放入一个数组里,怎么做?另外,我上面的代码是不是有问题?