@Test public void updateUserPassword() throws Exception{ Integer id=1; String passWord="999888"; String sql ="UPDATE user_jdbct SET PASSWORD = ? WHERE ID = ?"; int rows = jdbcTemplate.update(sql, passWord, id); System.out.println(rows); }
@GetMapping("updateUserPassword") public String updateUserPassword(int id, String passWord) throws Exception { String sql = "UPDATE user SET PASSWORD = ? WHERE ID = ?"; int rows = jdbcTemplate.update(sql, passWord, id); return "执行成功，影响" + rows + "行"; }
UserController { @GetMapping("updateUserPassword") public String updateUserPassword(int id, String passWord) throws Exception { String sql = "UPDATE user SET PASSWORD = ? WHERE ID = ?"; int rows = jdbcTemplate.update(sql, passWord, id); return "执行成功，影响" + rows + "行"; } }
UserController { @GetMapping("updateUserPassword") public String updateUserPassword(int id, String passWord) throws Exception { String sql = "UPDATE user SET PASSWORD = ? WHERE ID = ?"; int rows = jdbcTemplate.update(sql, passWord, id); return "执行成功，影响" + rows + "行"; }  }
UserController { @GetMapping("updateUserPassword") public String updateUserPassword(int id, String passWord) throws Exception { String sql = "UPDATE user SET PASSWORD = ? WHERE ID = ?"; int rows = jdbcTemplate.update(sql, passWord, id); return "执行成功，影响" + rows + "行"; }  @GetMapping("createUserTable") String createUserTable(); @GetMapping("saveUserTest") String saveUserTest(); @GetMapping("batchSave") String batchSaveUser(); @GetMapping("add") String addUser(String userName, String passWord); @GetMapping("updateUserPassword") String updateUserPassword(int id, String passWord); @GetMapping("deleteUserById") String deleteUserById(int id); @GetMapping("getUserByName") List getUserByName(String userName); @GetMapping("getMapById") Map getMapById(Integer id); @GetMapping("getUserById") User getUserById(Integer id); @GetMapping("list") List<User> list(); }
UserController { @GetMapping("updateUserPassword") public String updateUserPassword(int id, String passWord) throws Exception { String sql = "UPDATE user SET PASSWORD = ? WHERE ID = ?"; int rows = jdbcTemplate.update(sql, passWord, id); return "执行成功，影响" + rows + "行"; }  @GetMapping("createUserTable") String createUserTable(); @GetMapping("saveUserTest") String saveUserTest(); @GetMapping("batchSave") String batchSaveUser(); @GetMapping("add") String addUser(String userName, String passWord); @GetMapping("updateUserPassword") String updateUserPassword(int id, String passWord); @GetMapping("deleteUserById") String deleteUserById(int id); @GetMapping("getUserByName") List getUserByName(String userName); @GetMapping("getMapById") Map getMapById(Integer id); @GetMapping("getUserById") User getUserById(Integer id); @GetMapping("list") List<User> list();  }