Package org.mybeans.dao

Examples of org.mybeans.dao.DAOException


  }
  public int size() throws DAOException{
    try{
      return factory.getBeanCount();
    }catch(RollbackException e){
      throw new DAOException(e);
    }
  }
View Full Code Here


        }
          Transaction.commit();
          return Large;
      }catch (RollbackException e) {
        try {
          throw new DAOException(e);
        } catch (DAOException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
      }
View Full Code Here

      // a problem after leaving your web app running for several hours.)
      userTable.setIdleConnectionCleanup(true);
      // Get a BeanFactory which the actions will use to read and write rows of the "user" table
      factory = userTable.getFactory();
    } catch (BeanFactoryException e) {
      throw new DAOException(e);
    }
  }
View Full Code Here

      Transaction.begin();
      User dbUser = factory.create(user.getEmailAddress());
      factory.copyInto(user,dbUser);
      Transaction.commit();
    } catch (DuplicateKeyException e) {
      throw new DAOException("A user named "+user.getEmailAddress()+" already exists");
    } catch (RollbackException e) {
      throw new DAOException(e);
    } finally {
      if (Transaction.isActive()) Transaction.rollback();
    }
  }
View Full Code Here

  public User lookup(String EmailAddress) throws DAOException{
    try {
      return factory.lookup(EmailAddress);
    } catch (RollbackException e) {
      throw new DAOException(e);
    }
  }
View Full Code Here

    try {
      Transaction.begin();
      User dbUser = factory.lookup(user.getEmailAddress());

      if (dbUser == null){
        throw new DAOException("User "+user.getEmailAddress()+" no longer exists");
      }
      dbUser.setFirstName(user.getFirstName());    
      dbUser.setLastName(user.getLastName());
      dbUser.setGender(user.getGender());
      Transaction.commit();
    } catch (RollbackException e) {
      throw new DAOException(e);
    } finally {
      if (Transaction.isActive()) Transaction.rollback();
    }
  } 
View Full Code Here

  public User[] getGender(String gendertype) throws DAOException {
    try {
      User[] users = factory.match(MatchArg.equals("gender",gendertype));
      return users;
    } catch (RollbackException e) {
      throw new DAOException(e);
    }
  }
View Full Code Here

  public User[] getFirstNameUser(String firstName) throws DAOException {
    try {
      User[] users = factory.match(MatchArg.equals("firstName",firstName));
      return users;
    } catch (RollbackException e) {
      throw new DAOException(e);
    }
  }
View Full Code Here

  public User[] getLastNameUser(String lastName) throws DAOException {
    try {
      User[] users = factory.match(MatchArg.equals("lastName",lastName));
      return users;
    } catch (RollbackException e) {
      throw new DAOException(e);
    }
  }
View Full Code Here

  @Override
  public int size() throws DAOException {
    try {
      return factory.getBeanCount();
    } catch (RollbackException e) {
      throw new DAOException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.mybeans.dao.DAOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.