Use JNDI

Use the JNDI API to support the Java components you deploy on WAS. Specifically, you use the JNDI API to locate and refer to resources such as enterprise beans, data sources, and JavaMail sessions within a distributed computing environment.

The process of using JNDI to access enterprise-level Java components involves the following steps:

  1. Obtain the initial JNDI context for the component
    This topic describes how to obtain an initial JNDI context that contains the resource (a Java object).

  2. Use JNDI to look up Java components
    This topic explains how to look up resources such as enterprise beans, data sources, and JavaMail sessions.

After you have completed these steps, you can use the enterprise resource (such as an enterprise bean or data source) in your code exactly as you would if Java object had been available locally.