IBM Support

Enabling JDBC Tracing in RPG Invocated JVMs

Troubleshooting


Problem

This document provides a technique that can be used to turn on JDBC tracing for JVMs launched in an RPG program.

Resolving The Problem

This document provides a technique that can be used to turn on JDBC tracing for JVMs launched in an RPG program.

It is possible for native IBM iSeries RPG programs to call the JNI_CreateJavaVM() API to launch a Java program. In this environment, it is possible to provide JVM arguments for JDBC tracing without requiring a change to the native program. This is accomplished by using the QIBM_RPG_JAVA_PROPERTIES environment variable. The environment variable should be added before calling the RPG program that launches a JVM.

Native JDBC:

ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPERTIES) VALUE('-Djdbc.db2.trace=4;-Djdbc.db2.trace.config=file:///somedir/trace.txt;')


Toolbox JDBC:

ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPERTIES) VALUE('-Dcom.ibm.as400.access.Trace.category=all;-Dcom.ibm.as400.access.Trace.file=/somedir/trace.txt;')


NOTE: The final semi-colon is required in both examples. When this property is read, the final character in the value is considered the delimiter for multiple properties. If the final semi-colon is omitted, the properties will not be properly set.

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHZAA2","label":"Data Access"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

401887427

Document Information

More support for:
IBM i

Component:
Data Access

Software version:
All Versions

Operating system(s):
IBM i

Document number:
637851

Modified date:
28 April 2025

UID

nas8N1015185

Manage My Notification Subscriptions