【发布时间】:2012-07-17 20:41:23
【问题描述】:
我从同一个 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)
我检查它运行良好。我怀疑它会有任何副作用吗?
【问题讨论】:
标签: java database jdbc resultset