我从同一个Statement对象生成了 2 个ResultSet 。
代码示例如下:
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
con = DBAccess.getConnection();
stmt = con.createStatement();
rs = stmt.executeQuery(Query1);
// operate on the resultset
rs = stmt.executeQuery(Query2); // Is it legal and do not have side-effects?
// operate on the resultset
// close everythings (Resultset, Statement, Connection)
我检查它运行良好。我怀疑它会有任何副作用吗?