,當我有這個代碼的問題:JDBC例外「不允許操作的ResultSet關閉後,」迭代的ResultSet
ResultSet dane = statement.executeQuery("SELECT * FROM ProWarns WHERE blahblah = '" + cel + "'");
while (dane.next()) {
// some code (only get some string from result)
if (TimeEnd <= EndTime) {
statement.executeUpdate(
"DELETE FROM ProWarns WHERE id = '" + id + "'"); //and error
statement.executeUpdate(
"UPDATE ProWarnsPlayers SET num = '" + NewV + "'" WHERE Pl = '"+ tar + "'");
}
}
錯誤:java.sql.SQLException中:不允許操作的ResultSet關閉後。錯誤在哪裏,我該如何解決它?
PS:
我包括我的DB類的Pastebin,以防其有幫助。
hyym。那不會創建第二個線程? – user2250333
不,你不打算創建第二個線程,只是創建第二個語句對象。 – Perception