There are three main ways to set the environment properties for JNDI:
Use an environment object in the InitialContext constructor
Use system properties
Use resource files
Resource files allow you to externally define environment properties using files that follow the java.util.Properties format. This prevents you from having to change your source code when environment properties are changed. This usually is the best approach, but not all situations are the same, so you might need to use one of the alternative methods. The following sections describe each of the approaches.
The first method allows the environment properties to be set inside your JNDI client ...