Table of Contents

Java - Java Naming and Directory Interface (JNDI)

About

JNDI is an interface describing naming and directory functionalities.

It provides applications with methods for performing standard directory operations, such as:

Jndi Name Data Source Netbeans

The implementations can be plugged into the JNDI interface using the standard service provider interface (SPI) conventions.

JNDI implementation:

Lookup

Three JNDI namespaces are used for portable JNDI lookups:

global

The java:global JNDI namespace is the portable way of finding remote enterprise beans using JNDI lookups.

JNDI global addresses are of the following form:

java:global[/application name]/module name/enterprise bean name[/interface name]

where:

module

The java:module namespace is used to look up local enterprise beans within the same module. JNDI addresses using the java:module namespace are of the following form:

java:module/enterprise bean name/[interface name]

where:

app

The java:app namespace is used to look up local enterprise beans packaged within the same application. That is, the enterprise bean is packaged within an EAR file containing multiple Java EE modules.

JNDI addresses using the java:app namespace are of the following form:

java:app[/module name]/enterprise bean name[/interface name]

where:

Example

For example, if an enterprise bean, MyBean, is packaged within the web application archive myApp.war, the module name is myApp.

The JNDI name using :

Data Source

With JNDI data source, you can take advantage of connection pooling.

Documentation / Reference