beforeFirst()
を削除すると、私の機能は最初にResultSet
に記録され、終了します。 beforeFirst()
を使用すると、エラーResultSet IS_TYPE_FORWARD_ONLY
が発生します。rs.next()が別のレコードに移動しない理由
try {
ResultSet rs = stat.executeQuery("select _id, godziny_id from tblZmiany where harmonogram_id = " + h_id + " order by pracownik_id, Dzien");
rs.beforeFirst();
while (rs.next()) {
if (stat.executeUpdate("insert into tblWykonanie (Zmiana_id, Godziny_id) values ('" + rs.getLong(1) + "', " + rs.getInt(2) + ");") < 1) {
// Jeśli insert nie wstawił kolejnego rekordu
error_code = "Wystąpił problem podczas zatwierdzania harmonogramu.";
return false;
}
}
} catch (SQLException e) {
e.printStackTrace();
System.out.println(e.getMessage());
return false;
} catch (Exception e) {
error_code = e.getMessage();
return false;
}
return true;
SQLエンジンのタイプは – mKorbel
なる場合がございますがリセットされているRS .executeUpdateであなたは、接続の作成時にプロパティを設定する必要がありますか? – Nadmin