Using JNDI, all naming service lookups are performed using a context. On connection to the naming service, an 'initial context' is provied. Using this intial context, we can gain access to other contexts in the namespace by performing a lookup for the context. A general lookup operation is provided to find and retrieve a resource in one step.
The classes in the JNDI API reflect this approach to resource access. Five packages provide the classes used in JNDI. These packages are described in Table 12-1.
|javax.naming||The main package for the API. Contains the classes for connecting to naming services and performing lookup operations for resources.|
|javax.naming.directory||Adds functionality for accessing ...|