Ejemplo n.º 1
0
  public void registerUser(String username, String password) {

    try {

      userDao.registerUser(username, password);
    } catch (Exception ex) {
      if (!(ex instanceof DaoException)) {
        ex.printStackTrace();
      }
      throw new ServiceException();
    }
  }
Ejemplo n.º 2
0
  public boolean doesUserExist(String userName) {

    try {
      String userFromDB = userDao.getUserName(userName);

      if (null != userFromDB) {
        if (userFromDB.equals(userName)) {
          return true;
        }
      }
    } catch (Exception ex) {
      if (!(ex instanceof DaoException)) {
        ex.printStackTrace();
      }
      throw new ServiceException();
    }

    return false;
  }