java.sql.SQLException: Operation not allowed after ResultSet closed
究根溯源,问题出现在 一个 Statement 对象必须只对应一个 ResultSet 对象,而且在 ResultSet对象执行完一个操作的时候,就会关闭 ResultSet。
Statement sta2 = conn.createStatement(); ResultSet res2 = sta2.executeQuery("SELECT * FROM t_customer"); res2 = sta2.executeQuery("SELECT * FROM t_customer");