Package com.titan.customer

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


    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

  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

    // 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

Related Classes of com.titan.customer.CustomerHomeRemote

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.