Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB and other Java EE Technologies and the fly likes JNDI Initial Context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI Initial Context" Watch "JNDI Initial Context" New topic
Author

JNDI Initial Context

Ravi Singh
Ranch Hand

Joined: Aug 02, 2004
Posts: 51
When creating an initial context for a J2EE application, you can construct the initial context in two ways:

InitialContext context = new InitialContext(); // No arguments

InitialContext context = new InitialContext(Hashtable hash); // Hashtable argument

I don't understand how you can create a connection to JNDI without specifying the properties (e.g. server URL) such is the case with the no argument constructor?

Please help, anyone.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

I don't understand how you can create a connection to JNDI without specifying the properties (e.g. server URL) such is the case with the no argument constructor


It assumes some default values like localhost etc.


Groovy
Ravi Singh
Ranch Hand

Joined: Aug 02, 2004
Posts: 51
So does it connect to the local JNDI server?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI Initial Context