1

Is it possible to call a java pgm that is hosted on my ibmi from the pc? I want to create a java program on my pc. The program should create a connection to my ibmi and call a java program hosted on my machine.

After searching in the web i try to find a solution in this forum. is that possible? what are the preferences that make that ?

edit the java program on my ibmi should call a rpg/cobol program to grab some data and return them to the calling java on my pc.

bye jogi

mike
  • 1,233
  • 1
  • 15
  • 36
user2976312
  • 113
  • 1
  • 8
  • what is the solution you found, have you tried that (or something else) yet ? – earthmover Jul 14 '15 at 09:28
  • i didnt find a solution so i asked in this forum. – user2976312 Jul 14 '15 at 09:54
  • There are multiple possibilities. A basic description of what the java pgm would do would help pick a direction. – user2338816 Jul 14 '15 at 10:03
  • ok, i changed my post. at first, the program on my ibmi should call exisiting RPG programs that grab data for statistics and return the data to the calling programm... – user2976312 Jul 14 '15 at 11:34
  • 1
    Can you clarify if you want to **write** java to run on IBM i and that you then will call it from your PC? Should we assume that you're a java developer? An example possibility is a java stored procedure. That'd be accessible from a PC. – user2338816 Jul 15 '15 at 01:17

3 Answers3

3

Take a look at the JT400 project...

The IBM Toolbox for Java is a library of Java classes supporting the client/server and internet programming models to a system running IBM i (or i5/OS or OS/400). The classes can be used by Java applets, servlets, and applications to easily access IBM i data and resources.

Charles
  • 21,637
  • 1
  • 20
  • 44
1

Charles is right. JT400 is the way to go.

Here is a functional example.

Please provide some feedback if you run in trouble.

Community
  • 1
  • 1
Jairo R. Flores
  • 724
  • 4
  • 11
  • JT400 looks very nice. i tested commandcalls and that worked fine. Is it also possible to call a java server-program on my ibmi from the pc ? – user2976312 Jul 15 '15 at 15:42
  • @user2976312, yes. There is a "Run Java Program" command. Under the "native" naming, this command is RUNJVA. However, IBM include an alias command simply named JAVA. – Charles Jul 15 '15 at 18:58
1

May I suggest looking at the answer to the following Stack Overflow post?

Accessing RPG on iSeries from Java

Depending on the situation, it might make more sense to call the RPG program directly from your PC's Java program. Otherwise, execute the CL Java command: JAVA CLASS(my.java.class) PARM('a' 'b' 'c') CLASSPATH('/path/to/jarFile.jar') using the CommandCall class as described in the above mentioned post.

Community
  • 1
  • 1
Tracy Probst
  • 1,839
  • 12
  • 13