Example 5-2. 簡単な削除例
以下は、簡単な DELETE を発行し、削除された行数を表示する例です。
int foovalue = 500;
PreparedStatement st = db.prepareStatement("DELETE FROM mytable where columnfoo = ?");
st.setInt(1, foovalue);
int rowsDeleted = st.executeUpdate();
System.out.println(rowsDeleted + " rows deleted");
st.close();