Properties p = new Properties(); // ... specify the JNDI properties specific to the vendor return new javax.naming.InitialContext(p);
try{ Context ctx = getInitialContext(); ShipHome home = (ShipHome)ctx.lookup("ShipHome"); Ship ship = home.create(1,"Paradise",3000,100000); int t = ship.getCapacity(); System.out.println("Capacity = "+t); }catch(Exception e){e.printStackTrace();}