×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Jon S wrote:
... I have spent quite some time reading and
looking at various examples on the web and even created my own java
program on the 400 and compiled it in above directory and got it to
work. ...
Further to what Matt said, if you have a working Java example that uses
the class, you can usually figure out the package for the class from the
Java code. I found this a Java example on the net that uses your class,
and the Java has this "import" statement and this use of the class:
import com.stalker.CGPro.*;
...
CGProCLI cli = new CGProCLI
That tells you that the package for CGProCLI is com.stalker.CGPRo, so
the class in your RPG prototype should be 'com.stalker.CGPro.CGProCLI'.
I hope you don't mind if I make a few comments on your RPG code.
- You'll probably find it easiest to use a named constant for the class
in your RPG program.
* Connect class
D CGConnectClass C 'com.stalker.CGPro.CGConnect'
* Connect object
D CGConnect S O CLASS(*JAVA:CGConnectCLass)
* Connect method
- Your prototype for CGConnect2 should have *CONSTRUCTOR as the method
name, not 'CGConnect'. Whenever the method name is the same as the
class name, it's a constructor. Another signal that it's a constructor
is the Java method header has no return value.
- It's useful to put the Java method header in the RPG comments.
* public CGProCLI(String host,int port,String user,String password)
* throws CGProException
D new_CGConnect2...
D PR Like(CGConnect)
D ExtProc(*JAVA:CGConnectCLass
D :*CONSTRUCTOR)
etc
As an Amazon Associate we earn from qualifying purchases.