Setting up your server to use SQLJ

Before running a Java™ program that contains embedded SQLJ statements, ensure that you set up your server to support SQLJ. SQLJ support requires that you modify the CLASSPATH environment variable for your server.

For more information about working with Java classpaths, see the following page:

Java classpath

Using SQLJ and J2SDK

To set up SQLJ on a server running any supported version of J2SDK, complete the following steps:

  1. Add the following files to the CLASSPATH environment variable for your server:
    • /QIBM/ProdData/Os400/Java400/ext/sqlj_classes.jar
    • /QIBM/ProdData/Os400/Java400/ext/translator.zip

    Note: You need to add translator.zip only when you want to run the SQLJ translator (sqlj command). You do not need to add translator.zip if you only want to run compiled Java programs that use SQLJ. for more information, see the following page:

    The SQLJ translator (sqlj)

  2. At an iSeries™ command prompt, use the following command to add a link to runtime.zip from your extensions directory. Type the command on one line, then press Enter.
         ADDLNK OBJ('/QIBM/ProdData/Os400/Java400/ext/runtime.zip')
         NEWLNK('/QIBM/UserData/Java400/ext/runtime.zip')
    For more information about installing extensions, see the following page:

    Install extensions for the IBM® Developer Kit for Java