Connecting to a Server Using JNDI

In jConnect, use the Java Naming and Directory Interface (JNDI) to provide connection information.

jConnect provides:
  • A centralized location where you can specify host names and ports for connecting to a server. You do not need to hard-code a specific host and port number in an application.

  • A centralized location where you can specify connection properties and a default database for all applications to use.

  • The jConnect CONNECTION_FAILOVER property for handling unsuccessful connection attempts. When CONNECTION_FAILOVER is true, jConnect attempts to connect to a sequence of host/port server addresses in the JNDI name space until one succeeds.

Using jConnect with JNDI, make sure that certain information is available in any directory service that JNDI accesses and that required information is set in the javax.naming.Context class.

Related tasks
Providing JNDI Context Information
Related reference
Connection URL for Using JNDI
Required Directory Service Information
CONNECTION_FAILOVER Property