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