Setting up the Java Language Environment

The Java language environment requires some additional set up before you can call functions from a macro:

  1. Create a batch file to launch the Java application because Net.Data cannot directly start a Java application. Net.Data uses this file to launch the Java Virtual Machine, which runs your Java function. The batch file must include the java-classpath statement to ensure the required Java packages (the standard and application-specific packages) can be found. For example, the batch file, launchjv.bat, contains the following java-classpath:
    java -classpath %CLASSPATH%;C:\DB2WWW\Javaclas dtw_samp %1 %2 %3 %4 %5 %6
    
  2. Define a cliette to work with the Java language environment in the Live Connection configuration file, dtwcm.cnf. Specify unique port numbers for the cliette and the related batch file name with the EXEC_NAME configuration variable. In the following example, the Java cliette name is defined as DTW_JAVAPPS and the EXEC_NAME configuration variable is set to the name of the batch file, launchjv.bat:
    CLIETTE DTW_JAVAPPS{
    MIN_PROCESS=1                <= Required: this value must be 1 because
                                    the JAVAPPS cliette is multi-threaded.
    MAX_PROCESS=1                <= Required: this value must be 1 because
                                    the JAVAPPS cliette is multi-threaded.
    EXEC_NAME=launchjv.bat       <= The name of the batch file that includes the
                                    classpath statements
    }
     
    

    When you start the Net.Data Connection Manager, Net.Data starts the Java cliette specified in the configuration file. The cliette becomes available to process Java language environment requests from your Net.Data macro applications.

  3. Update the DTW_JAVAPPS ENVIRONMENT path statement in the Net.Data initialization file, db2www.ini, by adding each
  4. cliette name to the statement. For example:
    ENVIRONMENT DTW_JAVAPPS  ( OUT RETURN_CODE ) CLIETTE "DTW_JAVAPPS"
    


[ Top of Page | Previous Page | Next Page | Index ]