
JDBC 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
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

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



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 'DBSAMPLE4' database in client-server mode.  

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

           % java -classpath /APP_HOME/lib/java/dmjdbc.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 'DBSAMPLE4' database in client-server mode.  

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

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


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

        1. Check whether JDK1.2 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 'DBSAMPLE4' database in client-server mode.  

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

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


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 'DBSAMPLE4' database in client-server mode.

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

             java -classpath C:\DBMaker\4.3\bin\dmjdbc.jar;
             C:\DBMaker\4.3\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 'DBSAMPLE4' database in client-server mode.

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

             java -classpath C:\DBMaker\4.3\bin\dmjdbc.jar;
             C:\DBMaker\4.3\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 'DBSAMPLE4' database in client-server mode.

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

             java -classpath C:\DBMaker\4.3\bin\dmjdbc.jar;
             C:\DBMaker\4.3\samples\JDBC ex_Resultset_update

