Additional RPG Coding for Using Java

When you are using ILE RPG with Java™, there are some functions normally handled by Java that must be handled by your RPG code. The RPG compiler takes care of some of these for you, but you must handle some of them yourself. This section shows you some sample RPG wrappers to do this work, explains how and when to call them, and suggests how to handle JNI exceptions.

The module that you create to hold these JNI wrapper functions should begin with the following statements:

    H thread(*serialize)
    H nomain
    H bnddir('QC2LE')
     /define OS400_JVM_12
     /copy qsysinc/qrpglesrc,jni
     /copy JAVAUTIL

The following RPG wrappers for JNI functions are described. See Figure 94 below for a complete working example. See Copy-file JAVAUTIL. for the copy file containing the prototypes and constants for the wrapper functions.



[ Top of Page | Previous Page | Next Page | Contents | Index ]