JNDI full name Java Naming and Directory Interface JNDI is a standard extension of the Java platform, providing a set of interfaces, classes, and concepts about namespaces. As with many other Java technology, JDNI is the technology of Provider-based, exposes an API and a service provider (SPI). This means that any name-based technology can provide services through JNDI, as long as JNDI supports this technology. JNDI currently supports the technology including LDAP, CORBA Common Object Service (COS) name service, RMI, NDS, DNS, Windows registry, and more. Many J2EE technologies, including EJB relying on JNDI to organize and locate entities. JDNI links the objects and names through the concept of binding. In a file system, the file name is bound to the file. In DNS, an IP address is bound to a URL. In the directory service, an object name is bound to an object entity. A set of bindings in JNDI is referenced as a context. A set of operations per context exposed is consistent. For example, each context provides a lookup operation that returns the corresponding object of the specified name. Each context provides a binding and removal of binding names to an object. JNDI uses a common way to expose the namespace, which is used to use the layered context and the sub-context of the same name syntax. Uses of JNDI: 1. You can use JNDI to get the properties of the Object class, such as: attribute attr = directory.getattributes .get ("email"); string email = (string) Attr.get (); 2. You can search for objects such as: foxes = Directory.Search ("o = wiz, c = us", "sn = fox", controls); looking for the name of Fox called Fox in the Wiz department employee? 3. You can use JNDI to query the Naming / Directory service to query the objects like Printers and Databases, such as: Query PrinterPrinter Printer = (Printer) Namespace.lookup (Printer.Print (Document); 4. You can use the JNDI list of special levels of namespace, such as: namingenumeration list = namespace.list ("o = widget, c = us"); while (list.hasmore ()) {NameClasspair entry = (NameClasspair) list. Next (); display (entry.getname (), entry.getclassname ());} The address of the translated by JNDI document: http://java.sun.com/products/jndi/overview.htmltomcat database connection pool configuration Java: Comp / Env represents your JVM environment, comp = component env = environment reprinted: http://www.cnblogs.com/sunsonbaby/archive/2004/08/22/35621.aspx