Using a URL as a Name to the Initial Context - Java Network

Java examples for Network:URL

Description

Using a URL as a Name to the Initial Context

Demo Code

import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Main {
  public static void main(String[] argv) {
    try {/*from   w  w  w.  ja v  a  2 s .  c om*/
      Object obj = new InitialContext().lookup("iiop://localhost/Sample");
    } catch (NamingException e) {
    }
  }
}

Result


Related Tutorials