Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery(sql); int colcount=rs.getMetaData().getColumnCount(); int rowcount=0; if(rs.next()) { rs.last(); rowcount=rs.getRow(); rs.first(); }
注意点:
必须先指定:stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);