FileDocCategorySizeDatePackage
Client_1.javaAPI DocExample949Sun Dec 12 13:29:40 GMT 1999com.titan.ship

Client_1

public class Client_1 extends Object

Fields Summary
Constructors Summary
Methods Summary
public static javax.naming.ContextgetInitialContext()


        Properties p = new Properties();
        // ... Specify the JNDI properties specific to the vendor.
        return new javax.naming.InitialContext(p);
    
public static voidmain(java.lang.String[] args)

        try {
            Context ctx = getInitialContext();
            // EJB 1.1: Use PortableRemoteObject.narrow() method
            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();}