Whata are the various JNDI Packages ?

The JNDI packages are divided into 5 packages:
javax.naming
javax.naming.directory
javax.naming.ldap
javax.naming.event.
javax.naming.spi

Naming

The javax.naming package contains of classes and interfaces for accessing naming services.

Context

The javax.naming package defines a Context interface,
which is the core interface for looking up, binding/unbinding,
renaming objects and creating and destroying  subcontexts.

Lookup

It is used to lookup the name of object and returns the object bound to that name.

Bindings:

Returns the enumeration of name to object bindings.
it is a tuple containing :
- name of the bound object
- name of the objects class
- and the object itself

List

returns enumeration of names containing an object's name
and the name of the object's class.

Name
an ordered sequence of zero or more components.

References

contains information on how to construct a copy of the object.

The Initial Context:

In JNDI, all naming and directory operations are performed relative to a context.
it provides a starting point for naming and directory operations.
Once you have an Initial context you can use to look up other contexts and objects.
Example:

DirContext context=new InitialDirContext();

Analytics