JSP Samples for DBMaster
--------------------------
1 General Description
2 Sample Files Purpose
3 How to Run This Sample on Linux

1 General Description
---------------------
    This is a sample bundled with DBMaster which shows users how to access
    data from DBMaster via JDBC interface and present data using JSP pages.
    
    When users run this sample, it will first create sample table and insert
    data, so that this sample can be used immediately.

    This sample can be run under Windows or non-Windows environment as long
    as there is a JSP enabled web server.

    It is tested under Mandrake Linux 7.0. 
    We use JDK1.3.1 and TOMCAT 4.0.1 provided by Sun and Jakarta.

2 JSP Sample Files Purpose
--------------------------
    Sample: StartUp.jsp

    Purpose:
        This file prepares sample data for data manupulations with JSP.
        1. Connect To Database
        2. Create Table
        3. Insert Sample Data

    Sample: Welcome.html

    Purpose:
        This file is a menu which let users choose what they want to do with
        sample data.

    Sample: Insert.html

    Purpose:
        This file provides a GUI for user to type in data they want to
        insert into sample table.

    Sample: Insert.jsp

    Purpose:
        This file does the actual inserting when requested.

    Sample: Delete.jsp

    Purpose:
        This file demonstrates deletion of sample data.

    Sample: Update.jsp

    Purpose:
        This file demonstrates update of sample data.

    Sample: Query.html

    Purpose:
        This file provides a GUI for user to specify their query condition.

    Sample: GetResult.jsp

    Purpose:
        This file sends back the client query result.

    Sample: ErrorPage.jsp

    Purpose:
        This file serves as a JSP error page which handles exceptions thrown
        by other JSP files.

    Sample: Shutdown.jsp

    Purpose:
        This file demonstrates closing database connection in JSP.

    Sample: DbBean.java

    Purpose:
        This file is a JavaBean file which handles database requests from
        JSP files.

3 How to Run JSP Samples
------------------------

    (Note: <DBMASTER> = DBMaster installation directory
           <TOMCAT>  = TOMCAT installation directory
           <JDK>     = JDK installation directory

    (1) On Linux
    
    To run this sample on Linux using TOMCAT, you have to do the following(*):

    a. Install JDK: Tomcat needs JDK 1.1.8 version or above. We use the JDK version
       is 1.3.1. You may get the JDK package from SUN web site. Please follow the
       install instruction to setup. 
    
    b. Install TOMCAT: You may download TOMCAT from http://jakarta.apache.org/
       (1) tar zxvf jakarta-tomcat-4.0.1.tar.gz
       (2) mv akarta-tomcat-4.0.1 /usr/local/tomcat401
       (3) cd /usr/local
       (4) chmod -R 755 tomcat401
       (5) export TOMCAT_HOME=/usr/local/tomcat401
       (6) export JAVA_HOME=<JAVA>

    c. Environment setting (Below is use bash shell)
       (1) Edit /usr/local/tomcat401/bin/catalina.sh, add below 
           ...
           # ----- Execute The Requested Command -----------------------------------------
      
           # For DBMaster sample setting
           CP=/APP_HOME/samples/JSP:/APP_HOME/lib/java/dmjdbc.jar:${CP}   
           # End DBMaster sample setting
           
           echo "Using CLASSPATH:     $CP"
           ...
       (2) Edit /usr/local/tomcat401/conf/server.xml, add below
           ...
           <Context path="/DBM40" docBase="/APP_HOME/samples/JSP" debug="0"  reloadable="true" >
           </Context>
           <!-- Tomcat Examples Context -->
           ...
       (3) Setting library environment
           export LD_LIBRARY_PATH="/APP_HOME/lib/so::${LD_LIBRARY_PATH}"
    d. Launch TOMCAT
       /usr/local/tomcat401/bin/startup.sh
    
    e. Start the 'DBSAMPLE4' database in client-server mode.

    f. Launch a browser and locate to the sample URL address, starting with
       StartUp.jsp. For example, http://Your_Server_Addr:8080/DBM40/StartUp.jsp

    k. Then follow the instructions in pages, sample will demostrate
       function and show its results.

    Additional Note for Apache Users: 
    
    * There is a project under way between Sun and Apache which will in the
    end provide Apache users with built-in JSP support. For details, please
    go to http://jakarta.apache.org.
