Skip to main content

Problem:

Example of how the Java Native Interface can be used to call a Net Express COBOL DLL.

Resolution:

BUILD W/RELEASE:        Net Express v3.1 SP1 or later

===========          Net Express v4.0

                                       Sun JDK v1.3.xx

INTRODUCTION

==========

Example of how the Java Native Interface can be used to call a Net Express COBOL DLL.

SOURCE FILES:

==========

Program Files     Description

----------------     -----------------------------------------------------------

HelloWorldImp.cbl

Copy Files:

----------------     -----------------------------------------------------------

javatypes.cpy

jni.cpy

jnienv.cpy

Other Files:

----------------         -----------------------------------------------------------

Helloworld.java

buildit.bat

          Batch file to Compile the Java and Compile and link the Cobol program

SetupV31.bat

Batch file to setup the appropriate environment to run the demo with

                              Net Express v3.1

SetupV40.bat

Batch file to setup the appropriate environment to run the demo with

                             Net Express v4.0

OPERATION:

========

This demo was tested with the SUN JDK v1.3.xx

To be able to run this demo go to a Net Express Command Prompt;  

1)  If you are working with Net Express v3.1 execute the SetupV31 batch file

     If you are working with Net Express v4.0 execute the SetupV40 batch file

2)  Run the batch file buildit.bat from a Net Express command prompt. The COBOL program has a call to CBL_DEBUGBREAK that will prompt you if you want to animate the program.

NOTE:

====

Documentation references for this will be;

For Net Express v3.1 go to the Net Express bookshelf;

Distributed Computing Programming Guide Chapter 7 Also please review Chapter 6 - "Setting Up the COBOL and Java Environments" in section 6.2.1

For Net Express v4.0 you can refer to the Online Help under Contents;Programming;Distributing Computing;Part 3: Java and Cobol ;Chapter 7: Using Java and COBOL Together.

==========================================================

Keywords: Example, sample, demo, demonstration, mixed language, javatocob.zip

demo.ex

demo.ne

Attachments:

javatocob.zip

Old KB# 4345