Examples of CustomerHomeRemote


Examples of com.ibm.demo.entity.CustomerHomeRemote

  /**
   * @return
   */
  public List deniedLoans() {
   
    CustomerHomeRemote customerHome = null;
   
    try{
      Context jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("java:comp/env/ejb/CustomerHomeRemote");

      customerHome = (CustomerHomeRemote) PortableRemoteObject.narrow(obj, CustomerHomeRemote.class);
    } catch (NamingException ne){
      System.out.println("Naming Exception: " + ne.getMessage());
    }
   
    List granted = new ArrayList();
   
    //loop through all customers
    CustomerRemote customer = null;
    for (int i = 1; ; i++){
      Integer pk = new Integer(i);
      try{
        customer = customerHome.findByPrimaryKey(pk);
      } catch(FinderException fe){
        System.out.println("Find Exception: " + fe.getMessage());
        break;
      } catch(RemoteException re){
        System.out.println("Remote Exception: " + re.getMessage());
View Full Code Here

Examples of com.ibm.demo.entity.CustomerHomeRemote

   * @param loanAmount
   */
  public void submitLoanApplication(Integer id, String name, String address, Date birthdate,
                    String sssNo, Double annualSalary, Double loanAmount) {
   
    CustomerHomeRemote customerHome = null;
    CustomerRemote customer = null;
   
    try{
      Context jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("java:comp/env/ejb/CustomerHomeRemote");

      customerHome = (CustomerHomeRemote) PortableRemoteObject.narrow(obj, CustomerHomeRemote.class);
    } catch (NamingException ne){
      System.out.println("Naming Exception: " + ne.getMessage());
    }
   
    try{
      customer = customerHome.create(id, name, sssNo, address, birthdate, annualSalary, loanAmount);
      submit_count++;
    } catch(RemoteException re){
      System.out.println("Remote Exception: " + re.getMessage());
    } catch(CreateException ce){
      System.out.println("Create Exception: " + ce.getMessage());
View Full Code Here

Examples of com.ibm.demo.entity.CustomerHomeRemote

   * @return
   */
  public int getMaxPK(){
    int maxPK = 0;
   
    CustomerHomeRemote customerHome = null;
    CustomerRemote customer = null;
   
    try{
      Context jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("java:comp/env/ejb/CustomerHomeRemote");

      customerHome = (CustomerHomeRemote) PortableRemoteObject.narrow(obj, CustomerHomeRemote.class);
    } catch (NamingException ne){
      System.out.println("Naming Exception: " + ne.getMessage());
    }
   
    for(int pk = 1;;pk++){
      try{
        customer = customerHome.findByPrimaryKey(new Integer(pk));
      } catch(FinderException fe){
        System.out.println("Find Exception: " + fe.getMessage());
        maxPK = pk - 1;
        break;
      } catch(RemoteException re){
View Full Code Here

Examples of com.ibm.demo.entity.bmp.CustomerHomeRemote

               
                Context initial = new InitialContext();
                NamingEnumeration n = initial.list(initial.getNameInNamespace());
                while(n.hasMoreElements()) System.out.println(n.next());
                Object objref = initial.lookup("java:comp/env/CustomerHomeRemote");
                CustomerHomeRemote home = (CustomerHomeRemote) PortableRemoteObject.narrow(objref,CustomerHomeRemote.class);
                CustomerRemote customer = home.create(new Integer(txtMsg.getIntProperty("customerID")),txtMsg.getStringProperty("customerName"),
                    txtMsg.getStringProperty("customerSSS"),txtMsg.getStringProperty("customerAddress"), new SimpleDateFormat("mm/dd/yyyy").parse(txtMsg.getStringProperty("birthdate")),
            new Double(txtMsg.getDoubleProperty("customerSalary")),new Double(txtMsg.getDoubleProperty("customerLoan")));
                logger.info("SUCCESS!!!");
               
            } else {
View Full Code Here

Examples of com.titan.customer.CustomerHomeRemote

      }

            // obtain CustomerHome
            Context jndiContext = getInitialContext();
            Object obj = jndiContext.lookup("CustomerHomeRemote");
            CustomerHomeRemote home = (CustomerHomeRemote)
        PortableRemoteObject.narrow(obj, CustomerHomeRemote.class);
           
            // create Customers
            for(int i = 0; i < args.length; i++) {
                Integer primaryKey = new Integer(args[i]);
                String firstName = args[++i];
                String lastName = args[++i];
                CustomerRemote customer = home.create(primaryKey);
                customer.setFirstName(firstName);
                customer.setLastName(lastName);
                customer.setHasGoodCredit(true);
            }

            // find and remove Customers
            for(int i = 0; i < args.length; i+=3) { 
                Integer primaryKey = new Integer(args[i]);
                CustomerRemote customer = home.findByPrimaryKey(primaryKey);
                String lastName = customer.getLastName( );
                String firstName = customer.getFirstName( );
                System.out.print(primaryKey+" = ");
                System.out.println(firstName+" "+lastName);
View Full Code Here

Examples of com.titan.customer.CustomerHomeRemote

    try
    {
        // obtain CustomerHome
        Context jndiContext = getInitialContext();
        Object obj = jndiContext.lookup("CustomerHomeRemote");
        CustomerHomeRemote home = (CustomerHomeRemote)
          javax.rmi.PortableRemoteObject.narrow(obj, CustomerHomeRemote.class);

        System.out.println("Creating Customer 1..");
        // create a Customer
        Integer primaryKey = new Integer(1);
        CustomerRemote customer = home.create(primaryKey);
        
        // create an address data object
        System.out.println("Creating AddressDO data object..");
        AddressDO address = new AddressDO(new Integer(10),"1010 Colorado"
                      "Austin", "TX", "78701");
View Full Code Here

Examples of com.titan.customer.CustomerHomeRemote

  public static void main(String [] args) throws Exception {

    // obtain CustomerHome
    Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:/comp/env/ejb/CustomerHomeRemote");
    CustomerHomeRemote home = (CustomerHomeRemote)
      javax.rmi.PortableRemoteObject.narrow(obj, CustomerHomeRemote.class);

    System.out.println("Creating Customer 1..");
    // create a Customer
    Integer primaryKey = new Integer(1);
    CustomerRemote customer = home.create(primaryKey);
    
    // create an address data object
    System.out.println("Creating AddressDO data object..");
    AddressDO address = new AddressDO("1010 Colorado"
                    "Austin", "TX", "78701");
View Full Code Here

Examples of com.titan.customer.CustomerHomeRemote

    // obtain CustomerHome
    Context jndiContext = getInitialContext();
                // Keeping a different JNDI reference for the Customer Home class.
    Object obj = jndiContext.lookup("CustomerHomeRemote");
    CustomerHomeRemote home = (CustomerHomeRemote)
      javax.rmi.PortableRemoteObject.narrow(obj, CustomerHomeRemote.class);

    // create example customer
    System.out.println("Creating customer for use in example...");
    Integer primaryKey = new Integer(1);
    Name name = new Name("Monson", "Richard");
    CustomerRemote customer = home.create(primaryKey);
    customer.setName(name);

    // find Customer by key
    System.out.println("Getting name of customer using getName()..");
    customer = home.findByPrimaryKey(primaryKey);
    name = customer.getName();
    System.out.print(primaryKey+" = ");
    System.out.println(name.getFirstName( )+" "+name.getLastName( ));
               
    // change customer's name
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.