简体   繁体   English

利用Cobol程序中的Java API

[英]Utilizing Java API from a Cobol program

We have some COBOL programs running on our mainframe and we need one of those to communicate with our back end vault through a Java API. 我们在大型机上运行了一些COBOL程序,我们需要其中一个程序通过Java API与我们的后端库进行通信。 Is there any way a Cobol program can invoke the Java program? Cobol程序有没有办法调用Java程序?

Would it be possible to use a Web Service from Cobol? 是否可以使用Cobol的Web服务? How would I integrate a Cobol program with anything else? 我如何将Cobol程序与其他任何程序集成?

不知道这是否是您找到信息的地方,但此COBOL白皮书列表包含有关COBOL / Java集成的部分,包括一些特定于Enterprise COBOL的部分。

Found this: 发现这个:

A COBOL program can interoperate with JAVA. COBOL程序可以与JAVA互操作。

To achieve inter-language interoperability with Java™, you must follow certain rules and guidelines for: Using services in the Java Native Interface (JNI) Coding data types Compiling your COBOL programs You can invoke methods that are written in Java from COBOL programs, and you can invoke methods that are written in COBOL from Java programs. 要实现与Java™的语言间互操作性,必须遵循以下特定规则和准则:使用Java本机接口(JNI)中的服务编码数据类型编译COBOL程序您可以调用从COBOL程序以Java编写的方法,以及您可以从Java程序调用从COBOL编写的方法。 For basic Java object capabilities, you can use COBOL object-oriented language. 对于基本Java对象功能,您可以使用COBOL面向对象语言。 For additional Java capabilities, you can call JNI services. 对于其他Java功能,您可以调用JNI服务。

Because Java programs might be multi-threaded and use asynchronous signals, compile your COBOL programs with the THREAD option. 因为Java程序可能是多线程的并且使用异步信号,所以使用THREAD选项编译COBOL程序。

Also, we are using Cobol Enterprise, which has support for web services. 此外,我们正在使用Cobol Enterprise,它支持Web服务。 The integration shall then be done using the WS functionality found in Cobol Enterprise. 然后,使用Cobol Enterprise中的WS功能完成集成。

我不用COBOL编写代码,但在我的工作中,我们有一个MVS系统,程序员可以从COBOL输出XML / Web服务。

I'm guessing that any Java integration would be a vendor extension. 我猜测任何Java集成都是供应商扩展。 What compiler are you using? 你用的是什么编译器?

If your Cobol program is running as a batch job, you might be able to split it into two batch jobs, one that writes all of the queries for Java land into a file, and one that uses the answers from Java land. 如果您的Cobol程序作为批处理作业运行,您可以将其拆分为两个批处理作业,一个将Java land的所有查询写入文件,另一个使用Java land的答案。 Run a Java program between them that reads the query file and writes out an answers file. 在它们之间运行Java程序,读取查询文件并写出答案文件。

This is a shot in the dark but Dr Dobbs has a recent article on Cobol and Java ( see here ). 这是一个黑暗中的镜头,但Dobbs博士最近有一篇关于Cobol和Java的文章( 见这里 )。 On page 3, they mention running Cobol on the JVM with some vendor info. 在第3页,他们提到在JVM上运行Cobol并提供一些供应商信息。 That is quite a departure from your question but might lead to some new resources on the web. 这与您的问题完全不同,但可能会在网络上产生一些新资源。

For the AS/400 there is the IBM Java toolbox. 对于AS / 400,有IBM Java工具箱。 Check the java programming section in the infocenter. 检查信息中心的java编程部分。

微焦点确实允许COBOL和Java进行交互,但是为了满足您的需求,您需要使用名为OO COBOL的微焦点衍生物。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM