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

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 redhat Linux 9.0. 
    We use JDK1.4.2 and TOMCAT 4.1.3 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 This Sample on Linux
---------------------------------

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

    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.4.2. 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.1.3.tar.gz
       (2) mv jakarta-tomcat-4.1.3 /usr/local/tomcat413
       (3) cd /usr/local
       (4) chmod -R 755 tomcat413
       (5) export TOMCAT_HOME=/usr/local/tomcat413
       (6) export JAVA_HOME=<JAVA>

    c. Environment setting (Below is use bash shell)
       (1) Edit /usr/local/tomcat413/bin/catalina.sh, add below 
           ...
           # For DBMaster sample setting
           CLASSPATH="$CLASSPATH":/APP_HOME/lib/java/dmjdbc30.jar 
           or
           copy  dmjdbc30.jar to <TOMCAT_HOME>/common/lib 
           ...
       (2) Edit /usr/local/tomcat413/conf/server.xml, add below
           ...
           <Context path="/DBM50" docBase="/APP_HOME/samples/JSP" debug="0"  reloadable="true" >
           </Context>
           ...
       (3) Setting library environment
           export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/APP_HOME/lib/so
           
    d. Launch TOMCAT
       /usr/local/tomcat413/bin/startup.sh
    
    e. Start the 'DBSAMPLE5' 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/DBM50/StartUp.jsp

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

4 How to Run This Sample on Windows
-----------------------------------

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

    To run this sample on Windows 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.4.2. 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/
       We use the TOMCAT version is 4.1.3.
       install jakarta-tomcat-4.1.3.exe to <TOMCAT> e.g. C:\Tomcat413

    c. Environment setting 
       (1) Edit <TOMCAT>\bin\catalina.bat, add below
           (Note: C:\DBMaster\5.2 : DBMaster home directory)
           ...
           # For DBMaster sample setting
           set CLASSPATH=%CLASSPATH%;C:\DBMaster\5.2\bin\dmjdbc30.jar
           or 
           copy  dmjdbc30.jar to <TOMCAT>\common\lib
           # End DBMaster sample setting
           ...
       (2) Edit <TOMCAT>\conf\server.xml, add below
           ...
           <Context path="/DBM50" docBase="C:\DBMaster\5.2\samples\JSP" debug="0"  reloadable="true" >
           </Context>
           ...
       (3) Setting library environment
           export set PATH=%PATH%;C:\DBMaster\5.2\bin
                      
    d. Start TOMCAT in Start Menu
    
    e. Start the 'DBSAMPLE5' 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/DBM50/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.
