CachedRowSet crs = (CachedRowSet) getResultSet(sql); while (crs.next()) { System.out.print(crs.getString(1) + "/t"); System.out.print(crs.getString(2) + "/t"); System.out.println(crs.getString(3)); } public static ResultSet getResultSet(String sql) throws Exception { Connection conn = Oracle.getConnection(); System.out.println(conn); Statement stmt = conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery(sql); CachedRowSet crs = new CachedRowSetImpl(); crs.populate(rs); rs.close(); stmt.close(); conn.close(); return crs; }
Java 返回 Rowset
最新推荐文章于 2025-09-12 18:08:49 发布
