Home | Previous Page | Next Page   Connecting to the Database > Using an HTTP Proxy Server >

Using the Proxy with an LDAP Server

The proxy allows your JDBC applets and applications to alternatively get their database connection information from an LDAP server. If you plan to use this feature, you need to install an LDAP server. For general information about using an LDAP server with IBM Informix JDBC Driver, see the sections beginning with Connection Property Syntax.

Figure 2 illustrates how the proxy works with an LDAP server. The figure also shows lookup from an sqlhosts file; for more information, see Specifying sqlhosts File Lookup.

Figure 2. Lookup by the Proxy
begin figure description - This figure is described in the surrounding text. - end figure description

The proxy LDAP feature requires the JNDI class libraries and LDAP service provider files (jndi.jar, ldap.jar, and providerutil.jar). These JAR files can be downloaded from the following location: http://java.sun.com/products/jndi/index.html#download.

After downloading and installing the files, add their full pathnames to the CLASSPATH setting on your Web server. The files are in the lib directory under the installation directory.

Specifying Where LDAP Lookup Occurs

When used in conjunction with other LDAP keywords, the SQLH_LOC keyword indicates where an LDAP lookup should occur.

SQLH_LOC can have a value of either CLIENT or PROXY. If the value is CLIENT, the driver performs the LDAP lookup on the client side. If the value is PROXY, the proxy performs the lookup on the server side. If no value is specified, the driver uses CLIENT as the default value.

Here is the format for an applet or application URL with LDAP keywords that specifies a server side LDAP lookup:

jdbc:informix-sqli:informixserver=informix-server-name;
PROXY=proxy-hostname-or-ip-address:proxy-port-no?
PROXYTIMEOUT=60;SQLH_TYPE=LDAP;LDAP_URL=ldap:
//ldap-hostname-or-ip-address:ldap-port-no;LDAP_IFXBASE=dc=mydomain,dc=com;SQLH_LOC=PROXY;

This example obtains the database server hostname and port from an LDAP server:

jdbc:informix-sqli:informixserver=samsara;SQLH_TYPE=LDAP;
LDAP_URL=ldap://davinci:329;LDAP_IFXBASE=cn=informix,
o=kmart,c=US;LDAP_USER=abcd;LDAP_PASSWD=secret;SQLH_LOC=PROXY;
PROXY=webserver:1462

For a complete example of using an LDAP server with the proxy, see the proxy applet and application in the demo directory where your JDBC driver is installed.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]