The class name must be a fully qualified Java class name and is case sensitive. When prototyping a Java method, the expected format of the EXTPROC keyword is:īoth the class name and the method name must be character constants. The extended EXTPROC keyword can be used to specify the name of the method and the class it belongs to. The ILE RPG compiler must know the name of the method, the class it belongs to, the data types of the parameters and the data type of the returned value (if any), and whether or not the method is a static method.
Like subprocedures, Java methods must be prototyped in order to call them correctly. It is possible to have arrays of type O fields, but pre-runtime and compile-time tables and arrays of type O are not allowed. Note that both class names are fully qualified and that their case exactly matches that of the Java class.įields of type O cannot be defined as subfields of data structures. To declare a field that will hold an object of type String:ĭ string S O CLASS(*JAVA:’’) The class name is case sensitive.įor example, to declare a field that will hold an object of type BigDecimal:ĭ bdnum S O CLASS(*JAVA:’’) It must be a character literal or named constant, and the class name must be fully qualified. *JAVA identifies the object as a Java object.Class_name specifies the class of the object. The CLASS keyword accepts two parameters: To declare a field of type O, code O in column 40 of the D-specification and use the CLASS keyword to provide the class of the object.
This section includes information on calling Java methods from RPG and on writing RPG native methods.įields that can store objects are declared using the O data type. While most Java methods are written in Java, a method can also be written in another high-level language, such as RPG. Java methods can be called from your RPG program. In object-oriented programming, a ″method″ is a programmed procedure that is defined as part of a ″class″, which is a collection of methods and variables. Java programs can be developed using the VisualAge® for Java component of WebSphere Development Studio for iSeries. The Java programming language is a high-level object-oriented language developed by Sun Microsystems.