Like JDBC (Java Database Connectivity), JNDI is not a service, but a set of interfaces that allows applications to access many different directory service providers using a standardized API. The deployed enterprise beans in EJB have an environment-naming context that can be accessed using the JNDI API. It also accesses an enterprise resource such as a data source or JavaMail session in a distributed computing environment.
To do this, you must first obtain the initial context that contains the resource (a Java object).
The java.naming.Context interface provides methods for retrieving and updating this name-to-object binding environment in which each name passed as an argument to a Context method is relative to that context. A name parameter may never be null.
Storing and retrieving objects
from a JNDI namespace is quite straightforward. You first obtain a JNDI naming
context and then use the bind() and lookup() methods to store and retrieve
objects, as shown below:
Store and retrieve objects from a
default JNDI namespace
|
import javax.naming.*; |
Read more at:
http:/www.roseindia.net/software-tutorials/detail/3658
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: JNDI Context View All Comments
Post your Comment