Run the client application

If you have not refreshed or restarted your server since last modifying the Query or Glossary components, refresh the server now before running the client. Otherwise, verify that the server is running.

Run the client from using a batch file or UNIX shell script. The batch file or shell script configures the CLASSPATH environment variable, then runs the application using the JDK 1.3 java program included with your EAServer installation.

StepsCreating the Windows batch file

  1. Create a file named runtest.bat containing the commands below:

    call %JAGUAR%\bin\setenv.bat
    set CLASSPATH=%JAGUAR%\java\lib\easj2ee.jar;
    set CLASSPATH=%CLASSPATH%;%JAGUAR%\java\lib\easclient.jar
    set CLASSPATH=%CLASSPATH%;%JAGUAR%\java\classes
    set JAVA_HOME=%JAGUAR_JDK13%
    %JAVA_HOME%\jre\bin\java Sample.Intro.Glossary.TestClient %* 
    
    

StepsCreating the UNIX shell script

  1. Create a file named runtest containing the commands below:

    #!/bin/sh 
    . $JAGUAR/bin/setenv.sh
    CLASSPATH=$JAGUAR/java/lib/easj2ee.jar 
    CLASSPATH=$CLASSPATH:$JAGUAR/java/lib/easclient.jar
    CLASSPATH=$CLASSPATH:$JAGUAR/java/classes export CLASSPATH
    JAVA_HOME=$JAGUAR_JDK13
    $JAVA_HOME/jre/bin/java Sample.Intro.Glossary.TestClient $*
    
    
  2. Change the file permissions to allow the script to be executed. For example:

    chmod 777 runtest
    

StepsRunning the client application

  1. Run the batch or script file, specifying the server host name and IIOP port number on the command line as follows:

    runtest iiop://host:iiop-port
    

    For example:

    runtest iiop://myhost:9000
    

The client application:

  1. Creates a proxy for the Glossary entity bean’s home interface, then calls the create method to populate the database with some glossary entries.

  2. Creates a proxy for Query session bean’s home interface, then calls the runQuery method to get a result set containing all the entries, then prints them.

If errors occur, check the server log file for information on how to correct the problem.