SHARE
TWEET

update

a guest Oct 21st, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void update(Coffee c) {
  2.         String sql = "UPDATE COFFEES "
  3.                   + "SET PRICE = :price, SALES = :sales, TOTAL = :total "
  4.                   + "WHERE COF_NAME = :cof_name AND SUP_ID = :sup_id";
  5.         Map<String, Object> parameters = new HashMap<>();
  6.         parameters.put("price", c.getPrice().floatValue());
  7.         parameters.put("sales", c.getSales());
  8.         parameters.put("total", c.getTotal());
  9.         parameters.put("cof_name", c.getName());
  10.         parameters.put("sup_id", c.getSupplierId());
  11.         jdbc.update(sql, parameters);
  12.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top