JSP Samples for dbmaker
--------------------------
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 dbmaker which shows users how to access
    data from dbmaker 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.

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: <DBMAKER> = DBMaker installation directory
           <TOMCAT>  = Apache Tomcat installation directory
           <JAVA>     = JRE installation directory

    To run this sample on Linux using Apache Tomcat, you have to do the following(*):

    a. Install Apache Tomcat: You may download a binary distribution of Tomcat from 
	
	    https://tomcat.apache.org/
		
       (1) tar zxvf apache-tomcat-10.1.13.tar.gz
       (2) mv apache-tomcat-10.1.13 /usr/local/tomcat10
       (3) cd /usr/local
       (4) chmod -R 755 tomcat10

    b. Install JRE: Tomcat 10 is designed to run on JRE 11 Or Later.
       You may get the JRE package from oracle web site. Please follow the
       install instruction to setup.

       You may also use a full Java Development Kit (JDK) rather than just a JRE.	   
    
    c. Environment setting (Below is use bash shell)
       (1) copy /APP_HOME/lib/java/dmjdbc30.jar to <TOMCAT>/lib 
	   (2) copy /APP_HOME/samples/JSP to <TOMCAT>/webapps/JSP
       (3) Setting library environment
           export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/APP_HOME/lib/so
		   export CATALINA_HOME=/usr/local/tomcat10
		   export JRE_HOME=<JAVA>		   
           
    d. Launch TOMCAT
       /usr/local/tomcat10/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/JSP/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>  = Apache Tomcat installation directory
		   <JAVA>    = JRE installation directory

    To run this sample on Windows using Apache Tomcat, you have to do the following(*):

    a. Install Apache Tomcat: You may download a binary distribution of Tomcat from 
	
	   https://tomcat.apache.org/
		
       install apache-tomcat-10.1.13-windows-x64.zip to <TOMCAT> e.g. C:\Tomcat10

    b. Install JRE: Tomcat 10 is designed to run on JRE 11 Or Later. 
       You may get the JRE package from oracle web site. Please follow the
       install instruction to setup. 
	   
	   You may also use a full Java Development Kit (JDK) rather than just a JRE. 

    c. Environment setting 
       (1) copy C:\DBMaker\5.4\bin\dmjdbc30.jar to <TOMCAT>\lib
	   (2) copy C:\DBMaker\5.4\samples\JSP to <TOMCAT>\webapps\JSP
       (3) Setting library environment
           set PATH=%PATH%;C:\DBMaker\5.4\bin
		   set CATALINA_HOME=<TOMCAT>
		   set JRE_HOME=<JAVA>		   
                      
    d. Launch TOMCAT
	   <TOMCAT>\bin\startup.bat
    
    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/JSP/StartUp.jsp

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