• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I find , where the JNDI service is available?  RSS feed

prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!