What is the difference between Context & Initialcontext?
Context is the root of the JNDI namespace maintained by the server. Use the InitialContext constructor to get the same.
Context is the collection of namespaces ( resources ) found anywhere in the net. It could be a printer, a LDAP server,
a DNS server or a Remote Object.
IntialContext is the starting point to obtain a reference to any of the namespaces or resources.
JNDI uses contextfactory and a provider url to locate any namespace.
Ok, I would like to give a comparison from another view.
1. Context is an interface which is a part of JNDI specification while InitialContext is a class which implements Context!
2. InitialContext is Sun's reference implementation class
of Context. In other J2EE-compatible products, there may/maynot be InitialContext class.