Configuring your environment to use a proxy server

The HTTP proxy requires a web server that supports servlets, preferably a web server whose servlet engine uses a 2.1 or greater servlet API. The proxy is compatible with 2.0 and earlier servlet APIs, but the PROXYTIMEOUT feature is only enabled with a 2.1 or greater API.

To configure your environment for a proxy server:

  1. Define a servlet alias or context for the proxy servlet in your web server configuration.
    The JDBC driver directs all client HTTP requests to:
    http://your-web-server:port/pathname/IfxJDBCProxy
    where IfxJDBCProxy is the proxy servlet and pathname is the path to the proxy servlet. Consult your web server documentation for the correct way to configure servlets.
  2. Copy three class files—IfxJDBCProxy.class, SessionMgr.class, and TimeoutMgr.class—to the servlet directory you specified in the previous step.

    These class files reside in the directory proxy, which is under the installation directory for after the product bundle is installed.

  3. Add the file, ifxjdbc.jar, to the CLASSPATH setting on your web server.

    Some web servers use the CLASSPATH of the environment under which the server is started, while others get their CLASSPATH from a web server-specific properties file. Consult your web server documentation for the correct place to update the CLASSPATH setting.

  4. Start your web server and verify that the proxy is installed correctly by entering the following URL:
    http://server-host-name:port-number/servlet/
       IfxJDBCProxy
    The proxy replies with the following banner:
    -- Informix Proxy Servlet v220 Servlet API 2.1 --
    v220 represents the Informix® proxy version. Servlet API 2.1 represents the version of your web servers servlet API.

    If the servlet API is 2.0 or earlier, the banner says Servlet API 0.0.

  5. After configuring the proxy, append the following to your applet or applications URL:
    PROXY=server-host-name:port-number
    For example:
    jdbc:informix-sqli://123.45.67.89:1533:INFORMIXSERVER=
       myserver;user=rdtest;password=test;
       PROXY=webserver:1462;

Depending on your web server, the proxy servlet might be loaded when the web server is started or the first time it is referenced in the URL of your applet or application connection object.

The following websites offer more information about proxy servlets:
  • www.oracle.com
  • java.apache.org

Copyright© 2020 HCL Technologies Limited