文章目录 密码修改 优化密码修改 密码修改 dao //修改密码 public int modiPwd(String pwd, int id); daoImpl @Override public int modiPwd(String pwd, int id) { Connection connection = BaseDao.getConn(); PreparedStatement preparedStatement = null; int c = 0; if (connection != null) { String sql = "UPDATE `smbms_user` SET `userPassword`=? WHERE `id`=?"; Object[] params = { pwd, id}; c = BaseDao.executeU(connection, preparedStatement, sql, params); } BaseDao.close(connection, preparedStatement, null); return c; } service //修改密码 public boolean modifyPwd(String pwd, int id); serviceImpl @Override public boolean modifyPwd(String pwd, int id) { boolean flag = false; UserDao userDao = new UserDaoImpl(); int i =