Troubleshooting
Problem
This document describes the class path used by Java stored procedures.
Resolving The Problem
This document describes the class path used by Java stored procedures.
IBM Documentation lists the class path used by Java procedures as the following:
The user-defined classes used by the database Java virtual machine (JVM) can either be stored in the /QIBM/UserData/OS400/SQLLib/Function directory or in a JAR file registered to the database.
The /QIBM/UserData/OS400/SQLLib/Function is the IBM i equivalent of /sqllib/function, the directory where IBM DB2 on i saves Java stored procedures and Java UDFs (user-defined functions) on other operating systems. If the class is part of a Java package, it must be stored in the appropriate subdirectory. For example, if the myExample class is created as part of the foo.bar package, the file myExample.class must be in the Integrated File System directory, /QIBM/ProdData/OS400/SQLLib/Function/foo/bar.
The class file can also be placed in a JAR file that is registered to the database. The JAR file is registered by using the SQLJ.INSTALL_JAR stored procedure. This stored procedure is used to assign a JAR ID to a JAR file. This JAR ID is used to identify the JAR file in which the class file is stored. For more information about SQLJ.INSTALL_JAR and other stored procedures to manipulate JAR files, see SQLJ procedures that manipulate JAR files.
All Java stored procedures and Java UDF calls use the same class path. The class path consists of the function directory and all JAR files that are installed. Currently, the Java stored procedure support also uses all JAR files found in the /qibm/userdata/os400/sqlllib/function/jar directory. This feature is undocumented and there are no plans to support it in the future. Support for the SQLJ.ALTER_JAVA_PATH stored procedure to limit the JAR files that are visible to a particular Java STP/UDF invocation is being considered for a future release.
IBM Documentation lists the class path used by Java procedures as the following:
The user-defined classes used by the database Java virtual machine (JVM) can either be stored in the /QIBM/UserData/OS400/SQLLib/Function directory or in a JAR file registered to the database.
The /QIBM/UserData/OS400/SQLLib/Function is the IBM i equivalent of /sqllib/function, the directory where IBM DB2 on i saves Java stored procedures and Java UDFs (user-defined functions) on other operating systems. If the class is part of a Java package, it must be stored in the appropriate subdirectory. For example, if the myExample class is created as part of the foo.bar package, the file myExample.class must be in the Integrated File System directory, /QIBM/ProdData/OS400/SQLLib/Function/foo/bar.
The class file can also be placed in a JAR file that is registered to the database. The JAR file is registered by using the SQLJ.INSTALL_JAR stored procedure. This stored procedure is used to assign a JAR ID to a JAR file. This JAR ID is used to identify the JAR file in which the class file is stored. For more information about SQLJ.INSTALL_JAR and other stored procedures to manipulate JAR files, see SQLJ procedures that manipulate JAR files.
All Java stored procedures and Java UDF calls use the same class path. The class path consists of the function directory and all JAR files that are installed. Currently, the Java stored procedure support also uses all JAR files found in the /qibm/userdata/os400/sqlllib/function/jar directory. This feature is undocumented and there are no plans to support it in the future. Support for the SQLJ.ALTER_JAVA_PATH stored procedure to limit the JAR files that are visible to a particular Java STP/UDF invocation is being considered for a future release.
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"Data Access","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]
Historical Number
28272452
Was this topic helpful?
Document Information
More support for:
IBM i
Software version:
Version Independent
Operating system(s):
IBM i
Document number:
640239
Modified date:
24 June 2021
UID
nas8N1016814
Manage My Notification Subscriptions