try{
Context jndiContext = getInitialContext();
CabinHome home = (CabinHome)jndiContext.lookup("CabinHome");
Cabin cabin_1 = home.create(1);
cabin_1.setName("Master Suite");
cabin_1.setDeckLevel(1);
cabin_1.setShip(1);
cabin_1.setBedCount(3);
CabinPK pk = new CabinPK();
pk.id = 1;
Cabin cabin_2 = home.findByPrimaryKey(pk);
System.out.println(cabin_2.getName());
System.out.println(cabin_2.getDeckLevel());
System.out.println(cabin_2.getShip());
System.out.println(cabin_2.getBedCount());
}catch(java.rmi.RemoteException re){re.printStackTrace();}
catch(javax.naming.NamingException ne){ne.printStackTrace();}
catch(javax.ejb.CreateException ce){ce.printStackTrace();}
catch(javax.ejb.FinderException fe){fe.printStackTrace();}