Compiling and Running Samples

The scripts, runsamplesAPS or runsamplesEmbedded, compile all the sample programs but runs only one of them. To run the other sample programs, you must create your own scripts or modify the runsamplesAPS or runsamplesEmbedded script.

You can use the either of the runsamples scripts as a template for new scripts.

The following procedure shows you how to create a version of the runsamplesAPS script to run a different sample program.

  To create a version of the runsamples script to run another sample program:

  1. In the EPM_ORACLE_HOME\common\EssbaseJavaAPI\11.1.2.0\samples\japi directory, locate the runsamples script (.cmd on Windows systems, .sh on UNIX systems).

  2. Open the runsamples script in a text editor.

  3. In the script file, find the line that begins with echo Step-2 and replace %SAMPLE_PROG% with the name of a sample program (listed in The Sample Programs) :

    echo Step-2: Ready to run "%SAMPLE_PROG%" example ...
    pause  
    "%JAVA_HOME%\bin\java" com.essbase.samples.japi.%SAMPLE_PROG% %USER% %PASSWORD% %OLAP_SERVER% %PROVIDER_URL%

    To use the script to run another sample program, substitute the name of the sample program class for MetaData, as shown in the preceding sample.

  4. Save the script file in the EPM_ORACLE_HOME\common\EssbaseJavaAPI\11.1.2.0\samples\japi directory.

    Save the file with a .cmd extension on Windows or a .sh extension on UNIX.

  5. Optional: Repeat this procedure to create a separate script for each sample program that you want to run.