1
,所以我有這個問題不知道如何解決這個問題我想補充的ArrayList數據,如[A,B,C,d,E,F]第一條記錄看起來像這樣如何將ArrayList數據添加到derby中的相同#中?
"#"|| ID || numbers || section
`1 || 1 || Abcdef || A1
這裏是我的代碼
Statement st = conn.createStatement();
String sql = "INSERT INTO LOCATION (ID,LETTERS,SECTION) "
+ "VALUES (?,?,?)";
System.out.println(ch.size());
try (PreparedStatement insert = conn.prepareStatement(sql)) {
insert.setString(1, "1");
insert.setString(3, "A1");
for (int i = 0; i < ch.size(); i++) {
insert.setString(2, ch.get(i).toString());
insert.executeUpdate();
}
st.close();
conn.close();
}