Create and Initialize the ORB ORB orb ORB init new String -ORBInitialP

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// Create and Initialize the ORB
ORB orb = ORB.init(new String[]{"-ORBInitialPort", "1050", "-ORBInitialHost", "localhost"}, null);
org.omg.CORBA.Object object = orb.resolve_initial_references( "NameService" );
NamingContext context = NamingContextHelper.narrow( object );
System.out.println ( "The ORB has been created and initialized ..." );
// Resolve the object reference in naming
NameComponent component = new NameComponent( "dblite", "" );
NameComponent path [] = { component };
db = DBLiteHelper.narrow( context.resolve( path ) );
System.out.println ( "The Object Reference has been resolved in Naming ..." );