Prepared Execution: Beispiel
PreparedStatement pStmt;
pStmt = conn.prepareCall(
“UPDATE accounts SET balance = ?
WHERE id = ?”);
for (i=0; i<accounts.length; i++) {
pStmt.setLong(1, account[i].getBalance());
pStmt.setInt(2, account[i].getId());
pStmt.execute();
}
conn.commit();
pStmt.close();
Vorherige Folie
Nächste Folie
Zurück zur ersten Folie
Graphik-Version anzeigen