我看到下面的Clojure.java.jdbc
Clojure的DB-DO準備與多個參數調用
(sql/db-do-prepared db "INSERT INTO fruit2 (name, appearance, cost, grade) VALUES (?, ?, ?, ?)" ["test" "test" 1 1.0])
例如但是如何轉換以下java
代碼爲clojure
。我是新來clojure
和不知道如何傳遞多個vector
final int numRows = 10000;
PreparedStatement pstmt = conn
.prepareStatement("insert into new_order values (?, ?, ?)");
for (int id = 1; id <= numRows; id++) {
pstmt.setInt(1, id % 98);
pstmt.setInt(2, id % 98);
pstmt.setInt(3, id);
int count;
if ((count = pstmt.executeUpdate()) != 1) {
System.err.println("unexpected update count for a single insert " + count);
System.exit(2);
}
if ((id % 500) == 0) {
System.out.println("Completed " + id + " inserts ...");
}
}
對不起也許API改變,但我不會按照你的問題。你能否詳細說明一下? – Chiron