This file contains samples for JDBC drivers. Please read this file before
writing JDBC program


This file contains the following sections:

I.  JDBC type 2 samples
II. JDBC type 3 samples
III. JDBC type 4 samples

===========================================================================
I. JDBC type 2 Samples
===========================================================================
1 JDBC Sample Files Purpose
2 How to run JDBC Samples in UNIX
  2.1 run sample ex_ExecuteParam.java in UNIX
  2.2 run sample ex_Resultset.java in UNIX
  2.3 run sample ex_Resultset_update.java in UNIX
  2.4 run sample ex_ConnectRemote.java in UNIX
3 How to run JDBC Samples in Windows
  3.1 run sample ex_ExecuteParam.java in Windows
  3.2 run sample ex_Resultset.java in Windows
  3.3 run sample ex_Resultset_update.java in Windows
  2.4 run sample ex_ConnectRemote.java in Windows

1 JDBC Sample Files Purpose
---------------------------
    Sample: ex_ExecuteParam.java

    Purpose:
        This sample demonstrates how to use JDBC classes to insert data
        with parameters into database.

        1. register dbmaker driver
        2. connect to database
        3. create table jdbc_employee
        4. insert constant data into table jdbc_employee
        5. insert data into table jdbc_employee with parameters
        6. commit work
        7. drop table jdbc_employee
        8. close statements
        9. close connection


    Sample: ex_Resultset.java

    Purpose:
        This sample demonstrates how to use JDBC classes to select data
        from database

        1. register dbmaker driver
        2. connect to database
        3. create table jdbc_employee
        4. insert data into table jdbc_employee
        5. select data from table jdbc_employee
        6. close statements
        7. close connection

    Sample: ex_Resultset_update.java

    Purpose:
        This sample demonstrates how to use JDBC classes to update a result
        set selected from database

        1. register dbmaker driver
        2. connect to database
        3. create table jdbc_employee
        4. insert data into table jdbc_employee
        5. update data
        6. select data from table jdbc_employee
        7. close statements
        8. close connection

    Sample: ex_ConnectRemote.java

    Purpose:
        This sample demonstrates how to connect to remote database and
        manipulate remote database

        1. register dbmaker driver
        2. connect to database
        3. create table jdbc_employee
        4. insert data into table jdbc_employee
        5. select data from table jdbc_employee
        6. close statements
        7. close connection



2 How to run JDBC Samples in UNIX
--------------------------------------------------------

2.1 run sample ex_ExecuteParam.java in UNIX
--------------------------------------------------------

        1. Check whether JDK is installed on your machine.

        2. Set the classpath "/APP_HOME/lib/so" into your
           shell initialization file.
           (Note: /APP_HOME : dbmaker home directory)

           For sh (.profile), bash (.bashrc), add

           LD_LIBRARY_PATH=/APP_HOME/lib/so:$LD_LIBRARY_PATH
           export LD_LIBRARY_PATH

           For csh/tcsh (.cshrc), add

           setenv LD_LIBRARY_PATH /APP_HOME/lib/so

        3. Compile the java file. For example:

           % javac ex_ExecuteParam.java

        4. Start the 'DBSAMPLE5' database in client-server mode.

        5. Run the java class with classpath setting. For example:

           % java -classpath .:/APP_HOME/lib/java/dmjdbc30.jar:
             /APP_HOME/samples/JDBC ex_ExecuteParam



2.2 run sample ex_Resultset.java in UNIX
-----------------------------------------------------

        1. Check whether JDK is installed on your machine.

        2. Set the classpath "/APP_HOME/lib/so" into your
           shell initialization file.

           For sh (.profile), bash (.bashrc), add

           LD_LIBRARY_PATH=/APP_HOME/lib/so:$LD_LIBRARY_PATH
           export LD_LIBRARY_PATH

           For csh/tcsh (.cshrc), add

           setenv LD_LIBRARY_PATH /APP_HOME/lib/so

        3. Compile the java file. For example:

           % javac ex_Resultset.java

        4. Start the 'DBSAMPLE5' database in client-server mode.

        5. Run the java class with classpath setting. For example:

           % java -classpath .:/APP_HOME/lib/java/dmjdbc30.jar:
             /APP_HOME/samples/JDBC ex_Resultset


2.3 run sample ex_Resultset_update.java in UNIX
-----------------------------------------------------

        1. Check whether JDK is installed on your machine.

        2. Set the classpath "/APP_HOME/lib/so" into your
           shell initialization file.

           For sh (.profile), bash (.bashrc), add

           LD_LIBRARY_PATH=/APP_HOME/lib/so:$LD_LIBRARY_PATH
           export LD_LIBRARY_PATH

           For csh/tcsh (.cshrc), add

           setenv LD_LIBRARY_PATH /APP_HOME/lib/so

        3. Compile the java file. For example:

           % javac ex_Resultset_update.java

        4. Start the 'DBSAMPLE5' database in client-server mode.

        5. Run the java class with classpath setting. For example:

           % java -classpath .:/APP_HOME/lib/java/dmjdbc30.jar:
             /APP_HOME/samples/JDBC ex_Resultset_update


2.4 run sample ex_ConnectRemote.java in UNIX
-----------------------------------------------------

        1. Check whether JDK is installed on your machine.

        2. Set the classpath "/APP_HOME/lib/so" into your
           shell initialization file.

           For sh (.profile), bash (.bashrc), add

           LD_LIBRARY_PATH=/APP_HOME/lib/so:$LD_LIBRARY_PATH
           export LD_LIBRARY_PATH

           For csh/tcsh (.cshrc), add

           setenv LD_LIBRARY_PATH /APP_HOME/lib/so

        3. Compile the java file. For example:

           % javac ex_ConnectRemote.java

        4. Start the 'DBSAMPLE5' database in client-server mode.

        5. Run the java class with classpath setting. For example:

           % java -classpath .:/APP_HOME/lib/java/dmjdbc30.jar:
             /APP_HOME/samples/JDBC ex_ConnectRemote


3 How to run JDBC Samples in Windows
-----------------------------------------------------

3.1 run sample ex_ExecuteParam.java in Windows
-----------------------------------------------------

        1. Check whether JDK is installed on your machine.

        2. Compile the java file. For example:

             javac ex_ExecuteParam.java

        3. Start the 'DBSAMPLE5' database in client-server mode.

        4. Set PATH=%PATH%;C:\DBMaker\5.4\bin

        5. Run the java class with classpath setting. For example:
             java -classpath .;C:\DBMaker\5.4\bin\dmjdbc30.jar;
             C:\DBMaker\5.4\samples\JDBC ex_ExecuteParam


3.2 run sample ex_Resultset.java in Windows
-----------------------------------------------------

        1. Check whether JDK is installed on your machine.

        2. Compile the java file. For example:

             javac ex_Resultset.java

        3. Start the 'DBSAMPLE5' database in client-server mode.

        4. Set PATH=%PATH%;C:\DBMaker\5.4\bin

        5. Run the java class with classpath setting. For example:

             java -classpath .;C:\DBMaker\5.4\bin\dmjdbc30.jar;
             C:\DBMaker\5.4\samples\JDBC ex_Resultset

        (Note: If "classpath" is set in autoexec.bat, you don't need
        to specify it here.)


3.3 run sample ex_Resultset_update.java in Windows
-----------------------------------------------------

        1. Check whether JDK is installed on your machine.

        2. Compile the java file. For example:

             javac ex_Resultset_update.java

        3. Start the 'DBSAMPLE5' database in client-server mode.

        4. Set PATH=%PATH%;C:\DBMaker\5.4\bin

        5. Run the java class with classpath setting. For example:

             java -classpath .;C:\DBMaker\5.4\bin\dmjdbc30.jar;
             C:\DBMaker\5.4\samples\JDBC ex_Resultset_update


3.4 run sample ex_ConnectRemote.java in Windows
-----------------------------------------------------

        1. Check whether JDK is installed on your machine.

        2. Compile the java file. For example:

             javac ex_ConnectRemote.java

        3. Start the 'DBSAMPLE5' database in client-server mode.

        4. Set PATH=%PATH%;C:\DBMaker\5.4\bin

        5. Run the java class with classpath setting. For example:

             java -classpath .;C:\DBMaker\5.4\bin\dmjdbc30.jar;
             C:\DBMaker\5.4\samples\JDBC ex_ConnectRemote


===========================================================================
II. JDBC type 3 Samples
===========================================================================
1 Type 3 JDBC Sample File Purpose
2 How to Run Type 3 JDBC Sample


1 Type 3 JDBC Sample File Purpose
---------------------------------

    Sample:
        C:\DBMaker\5.4\Samples\JDBC\Employee.java
    Purpose:
        This sample demonstrates how to use type 3 jdbc to retrieve
        data from database.

      1. register dbmaker driver
      2. connect to database
      3. create table jdbc_employee
      4. insert data into table jdbc_employee
      5. select data from table jdbc_employee
      6. close statements
      7. close connection


2 How to Run Type 3 JDBC Samples
--------------------------------
    Steps:

        1. Check whether JDK is installed on your machine.

        2. Start the 'DBSAMPLE5' database in client-server mode.

        3. Start jetty server
        	 On Windows, there is a shortcut 'Start type 3 server'
        	 On Unix/Linux, there is a script t3svr under /APP_HOME/bin

        4. Compile the java file. For example:

           % javac Employee.java

        5. Run the java class with classpath setting. For example:
           On Windows,
           % java -classpath .;C:\DBMaker\5.4\bin\dmjdbct3c.jar Employee
           On Unix/Linux,
           % java -classpath .:/APP_HOME/lib/java/dmjdbct3c.jar Employee

===========================================================================
III. JDBC type 4 Samples
===========================================================================
1 Type 4 JDBC Sample File Purpose
2 How to Run Type 4 JDBC Sample

1 Type 4 JDBC Sample File Purpose
---------------------------------
    Sample:
        C:\DBMaker\5.4\Samples\JDBC\JdbcType4Example.java
    Purpose:
        This sample demonstrates how to use type 4 jdbc to retrieve
        data from database.

      1. register dbmaker driver
      2. connect to database
      3. insert data into table sample.employee
      4. select data from table sample.employee
      5. close statements
      6. close connection

2 How to Run Type 4 JDBC Samples
--------------------------------
	Steps:

        1. Check whether JDK is installed on your machine.

        2. Start the 'DBSAMPLE5' database in client-server mode.

        3. Compile the java file. For example:

           % javac JdbcType4Example.java

        4. Run the java class with classpath setting. For example:
           On Windows,
           C:\> java -classpath .;C:\DBMaker\5.4\bin\dmjdbct4.jar JdbcType4Example
           On Unix/Linux,
           % java -classpath .:/APP_HOME/lib/java/dmjdbct4.jar JdbcType4Example
