}
// 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);