Page 1
Advanced Integrated RPGIntegrating RPG with Java and Open Source
Session 1
Using Java with RPG
Tom Snyder
Page 2
RPG, OPM and ILE
Free Formatted RPG
Activation Groups
Procedures
Service Programs
Page 3
Java
Cross Platform
Virtual Machine
Supported on the IBM i
Access to Open Source
Page 4
Open Source
Apache POI – The Java API for Microsoft Documents
iText – Java-PDF Library
JavaMail – Platform Independent Email Framework
Page 5
Using Java with RPG
Accessing Java Objects from RPG
Working with the Java Virtual Machine
Java Native Interface
Page 6
Making a Reference Variable
Page 8
String Class, getBytes Method
Page 9
String Class Constructor
Page 10
QSYSINC/QRPGLESRC, JNI
Page 11
Garbage Collection
Page 12
Pushing And Popping Frames
Page 13
Java Primitive Types
Page 14
STDIN, STDOUT, STDERR
Page 15
Initialization Structures
Page 16
getJNIEnv File Descriptors
Page 17
getJNIEnv Create/Attach
Page 19
Thread Serialize
Recommend when using Java with RPG
Supports Multithreading
Prevents Access to More Than One Thread at a Time
Page 21
Static and Non StaticConceptual Example
Page 22
Static and Non StaticParameter Behavior
Page 23
Java Native Interface (JNI)
Sun/Oracle Java Native Interface (JNI) Specifications
ILE RPG Programmer’s Guide SC09-2507-06
Page 24
Conversion Descriptor - iconv
Page 25
iconv Data Structures
Page 26
Air_openConverter Procedure
Page 27
Air_convert Procedure
Page 28
Air_closeConverter Procedure
Page 29
QSYSINC/QRPGLESRC, JNIFindClass Prototype
Page 30
QSYSINC/QRPGLESRC, JNIGetStaticMethodID, GetMethodID
Page 31
JNI Type Signatures
Page 32
Get/Set<type>Field
Page 33
Dimension ClassPublic Fields and Methods
Page 34
JNI Code ExamplePrototypes, Variables and COPYs
Page 35
JNI Code ExampleConverting from EBCDIC to ASCII
Page 36
JNI Code ExampleFinding/Retrieving the Class and Fields
Page 37
JNI Code ExampleSetting and Displaying Public Fields
Page 38
External JarsLocations on the IFS
Page 39
Setting the Class Path
Page 40
Excel Spreadsheets with POI
Create Service Program
Create and Modify Excel Spreadsheets using RPG
Formatting and Formulas
Create Graphs and Charts
Page 41
PDFs using iText
Create Service Program
Create and Modify PDFs using RPG
Formatting, Tables and Links
Barcodes
Page 42
Send Email using JavaMail
Send Email Directly from RPG
Create HTML Formatted Email
Attach Electronic Documents
Embed Images into your Email
Page 43
Advanced Integrated RPG10% Discount Code: OMNI2010
Valid Through November 9th
http://www.mc-store.com/