public static User updatePasswordWithNew(boolean matchOldPassword, String oldPassword,
String newPassword, Integer iUserId, ApplicationContext appContext) throws SQLException, UserNotFoundEx {
UserRepository repo = appContext.getBean(UserRepository.class);
User user = repo.findOne(iUserId);
if (user == null) {
throw new UserNotFoundEx(""+iUserId);
}
PasswordEncoder encoder = encoder(appContext);
return updatePasswordWithNew(matchOldPassword, oldPassword, newPassword, user, encoder, repo);
}