IBM Support

JDK Considerations When Running Java Stored Procedures

Technical Blog Post


Abstract

JDK Considerations When Running Java Stored Procedures

Body

DB2 LUW is capable of running Java applications as stored procedures or user defined functions (Stored Procedures and UDFs are collectively referred to as routines). When a Java routine is invoked DB2 will load the class and start a JVM in a process called the db2fmp. Unlike other DB2 processes, this process is owned by the fenced user, so it is necessary for  the fenced user ID to have access to the libraries containing the application classes and the JVM. By default the JDK that is shipped with DB2 is used.  You can use a JDK other than the one shipped with DB2 by modifying the JDK_PATH dbm cfg variable to point to the location of the desired JDK. If you are using a 1.6 JDK it will be necessary to set the environment variable DB2LIBPATH to the path containing the JDK. Not every JDK is supported for running routines. Supported JDKs are documented in the DB2 Infocenter. The JDKs supported for version 9.7 are listed at the following URL.


http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.qb.server.doc%2Fdoc%2Fr0011932.html


In order to execute a Java routine DB2 will start a JVM in the db2fmp. On AIX systems the db2fmp will be unable to start a JVM if the Stack Execution Disable mode is set to “all' or “setidfiles”. If the SED is set to one of these modes it will be necessary to change the mode in order to run Java routines. You can verify the setting of the SED by issuing the command sedmgr.


For information on General routine performance including additional information on Java routines see the following URL.

http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.apdv.routines.doc%2Fdoc%2Fc0009051.html


See the following URL for information on modifying the dbm cfg variable JDK_PATH


http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.apdv.gs.doc%2Fdoc%2Ft0010264.html

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm11141720