Setting up the environment for Java routines

Before you can run Java routines, you need to set up a WLM environment and set Java environment variables.

Before you begin

Before you can prepare and run Java routines, you need to satisfy the following prerequisites:
  • Java 2 Technology Edition, V5 or later.

    The IBM® Data Server Driver for JDBC and SQLJ supports 31-bit or 64-bit Java routines. For 64-bit Java routines, you need Java 2 Technology Edition, V6 or later.

  • TCP/IP

    TCP/IP is required on the client and all database servers to which you connect.

  • The 4.xx version of the IBM Data Server Driver for JDBC and SQLJ that matches the Db2 for z/OS® version.

    If you are migrating from a previous release of Db2 for z/OS, you need to install the corresponding version of the IBM Data Server Driver for JDBC and SQLJ.

About this task

The steps in this task are necessary for preparing and running Java routines.

If you plan to use IBM Optim™ Development Studio to prepare and run your Java routines, see Developing Db2 for z/OS stored procedures (IBM Data Studio)

Procedure

To set up the environment for running Java routines, you need to perform these tasks:

  1. Ensure that your operating system, SDK for Java, and the IBM Data Server Driver for JDBC and SQLJ are at the correct levels, and that you have installed all prerequisite products.

    Important: If you have migrated the Db2 subsystem from a previous release of Db2 for z/OS, your existing Java stored procedures and user-defined function no longer work with the previous release of the IBM Data Server Driver for JDBC and SQLJ and the current release of Db2 for z/OS. You need to install the version of the IBM Data Server Driver for JDBC and SQLJ that matches the Db2 for z/OS release level, and update the WLM-managed stored procedure address space configuration and JAVAENV data set to use the current driver.

  2. Create the Workload Manager for z/OS (WLM) application environment for running the routines.
  3. Set up the run-time environment for Java routines, which includes setting environment variables.