How to Construct the Exercise II (Cont.)

  1. Calling a CGI (Common Gateway Interface) Script (Unix Shell) CGI is a standard for running external programs from a World-Wide Web HTTP server. CGI specifies how to pass arguments to the executing program as part of the HTTP request. It also defines a set of environment variables. Commonly, the program will generate some HTML pages which will be passed back to the browser. For the previous interface, the following CGI script ListTitiles.cgi is activated once a button is clicked:

    ~wenchen/public_html/cgi-bin/351/week10/ListTitles.cgi
    #!/bin/sh
    
    PATH=$PATH:/home/Agassiz:/usr/java/bin:/usr/java/sdk/bin
    
    CLASSPATH=.:/home/Agassiz/project/oracle/OraHome1/jre/1.1.8
    CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/jlib
    CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/jdbc/lib/classes12.zip
    CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/jdbc/lib/nls_charset12.zip
    CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/sqlj/lib/runtime.zip
    CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/sqlj/lib/translator.zip
    CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/ord/jlib
    CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/ord/ts/jlib
    CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/rdbms/jlib
    CLASSPATH=$CLASSPATH:/usr/j2se/bin
    
    export CLASSPATH
    perl ListTitles.pl

    Note that this script is for setting the JDBC environment variables. If JDBC is not used in this function, you may skip this step.
    Some of the statements may not be necessary. The last statement calls a CGI Perl script, ListTitles.pl .