Programación Java-Cobol

Páginas: 6 (1473 palabras) Publicado: 19 de junio de 2012
Using Java and COBOL Together
This chapter introduces the different ways that Java and COBOL applications can call each other.

Overview
There are a number of ways of using COBOL and Java together. You can use the Interface Mapping Toolkit, the wizards and GUI tools to create interfaces to COBOL from Java, or you can hand code the calls using the supplied support libraries. Java itselfprovides access to other technologies, such as Remote Method Invocation (RMI) and Java Naming and Directory Interface (JNDI) which enable you to distribute objects across different machines. You can use COBOL and Java together by: Mapping a Java interface onto procedural COBOL, using the Interface Mapping Toolkit, thereby exposing COBOL services without changing the COBOL. The new interface then needsdeploying, which involves deploying the generated EJB to J2EE and the mapping information to an enterprise server. At run time, the EJB running under J2EE calls the COBOL, which runs under the control of an enterprise server. See the chapter Mapping a Java Interface and Using Resource Adapters . Calling procedural COBOL from Java, using the support provided in the com.microfocus.cobol.RuntimeSystemclass. This class is extended to provide the CobolBean class. This RuntimeSystem class support also enables you to call Java from procedural COBOL, through the Java Native Interface (JNI). This is ideal for use with Java 2 Standard Edition (J2SE). See the chapter Calling Procedural COBOL from Java. Calling Java from OO COBOL, using the Java object domain for OO COBOL. This is ideal for use withJava 2 Standard Edition (J2SE). See the chapter Calling OO COBOL from Java Calling OO COBOL from Java, using the Class wizard to create a Java wrapper class that provides a function for each method in the OO COBOL class. This is ideal for use with Java 2 Standard Edition (J2SE). See the chapter Calling Java from COBOL Although Enterprise Server for Windows is required to run legacy programs exposedusing the Interface Mapping Toolkit, you can choose to use Enterprise Server for Windows or Application Server for Net Express (or for Server Express) for running the other types of applications that use both COBOL and Java programs. The Java language defines its own data types, which are different to the ones used in COBOL. The COBOL run-time system automatically converts between COBOL and Javatypes whenever you call Java from COBOL or COBOL from Java. Where a COBOL data type cannot be translated directly (for example, edited fields), it is translated to a string. Where a COBOL data type cannot be translated directly (for example, edited fields), it is under some circumstances translated to a string. See the chapter Java Data Types

Setting Up the Environment for Java and COBOL
Youneed a Java run-time system on any machine which is going to execute Java applications. If you are going to develop mixed Java and COBOL applications, you will also need a Java development environment. You can use either the Java Software Development Kit available from Sun, or any Java IDE which is based on either the Sun or Microsoft run-time environments listed below. Net Express currentlysupports the following Java run-time systems on Windows: The Sun Java SDK 1.2.2 or 1.3 (this is for development) The Sun Java Runtime Environment 1.2.2 or 1.3 or 1.4 (this is a distributable run-time environment you can use for shipping applications) Before you start writing COBOL and Java programs which interact, you need to set up the following environment variables for the COBOL and Java run-timesystems: COBJVM If you have COBOL programs which are going to call Java, you must tell the COBOL run-time system which Java run-time system you are using. To do this, set environment variable COBJVM to one of the following: SUN (for the Sun run-time system). For example:
set cobjvm=SUN

PATH In addition, if you are using the Sun Java run-time system, add the subdirectory containing the jvm.dll...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Cobol lenguaje de programación
  • Programacion Java
  • Programacion Java
  • Programacion en java
  • programacion java
  • programacion en java
  • Programacion java
  • Programacion java

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS