try{
Context jndiContext = getInitialContext();
CustomerHome custHome = (CustomerHome)jndiContext.lookup("CustomerHome");
Customer customer = custHome.findByPrimaryKey(new CustomerPK(1));
CruiseHome cruiseHome = (CruiseHome)jndiContext.lookup("CruiseHome");
Cruise cruise = cruiseHome.findByPrimaryKey(new CruisePK(1));
CabinHome cabinHome = (CabinHome)jndiContext.lookup("CabinHome");
CabinPK pk = new CabinPK();
pk.id = 22;
Cabin cabin = cabinHome.findByPrimaryKey(pk);
ReservationHome home = (ReservationHome)jndiContext.lookup("ReservationHome");
Reservation res = home.create(customer,cruise,cabin,1300);
System.out.println(res.getCustomerID());
System.out.println(res.getCruiseID());
System.out.println(res.getCabinID());
}catch(java.rmi.RemoteException re)
{
System.out.println("RemoteException thrown");
re.printStackTrace();
}
catch(Throwable t)
{
t.printStackTrace();
}