2
を閉じずに、次のコードクローズResultSetの私のアプリケーションでのステートメント
ResultSet images = statement.executeQuery("SELECT id, filename, run" +
" FROM images" +
" JOIN comparer_results results ON results.toImageId = images.id" +
" WHERE result <= 100");
while (images.next()) {
statement.executeUpdate("DELETE FROM images WHERE id = "
+ images.getInt("id"));
File imageFile = new File(config.getProperty("system.imageDirectory")
+ File.separator
+ images.getString("filename") + ".jpg");
}
はimageFile
がインスタンスを取得ラインで
java.sql.SQLException: Operation not allowed after ResultSet closed
例外をスローします。これはimages.getString("filename")
の操作によって発生したと私は理解しています。しかし、ResultSetはなぜ閉じられていますか?私はそのようなメソッドを呼び出すことはありませんし、結果セット(images.getInt("id")
)の最初の操作は正常に動作します。