How can I find , where the JNDI service is available?
posted 11 years ago
I agree that I can have a Distributed object from JNDI lookup, but before making a lookup I need to write a code as
Hashtable envHash = new Hashtable(); envHash.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); envHash.put(Context.PROVIDER_URL, "iiop://localhost:2809/"); Context context = new InitialContext(envHash); DataSource source = (DataSource) context.lookup("jndiJdbc");
But what is criteria for providing "Context.PROVIDER_URL" ? I read from diffferent sites , but I am not getting , where this JNDI service resides? How can I locate this service & determine that it is working or not? Suppose I have a Database located on PC_X; then for its looup what should I use "iiop://localhost:2809/" or "iiop://PC_X:2809/" or how can I decide that where is JNDI available on my network? I am getting confused here ...