|
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3) B14428-01 |
|
![]() Previous |
![]() Next |
If the client is collocated with the target, the client exists within the same application as the target, or the target exists within its parent, then you do not need to initialize JNDI properties. Otherwise, you must initialize JNDI properties in one of the following ways:
This section describes:
For more information, see:
You can set JNDI properties in a file named jndi.properties that conforms to the requirements specified in the java.util.Properties method load.
If setting the JNDI properties within the jndi.properties file, make sure that this file is accessible from the client CLASSPATH.
Set JNDI properties as follows:
<PropertyName>=<PropertyValue>
For example:
java.naming.factory.initial= oracle.j2ee.server.ApplicationClientInitialContextFactory
For property names, see the field definitions in javax.naming.Context.
For an example, see "Specifying Credentials in JNDI Properties".
You can set JNDI properties as system properties specified either on the command line as a -D argument or as an environment reference (see "Configuring an Environment Reference to an Environment Variable").
You can set JNDI properties by creating a HashTable and populating it with the required properties using javax.naming.Context fields as keys and String objects as values. When you instantiate the initial context, pass the HashTable into the the initial context constructor.
For an example, see "Specifying Credentials in the Initial Context".