× 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.



Ramprasad,

You need to link your java class file to your RPG program like so...

d javaString      s                   o   class(*java:'java.lang.String')
d parm1           s                   o   like(javaString)
d parm2           s                   o   like(javaString)
d returnValue   s                500a varying
...
d myclass       pr              o   class(*java: 
d                                     'java.lang.String') 
d                                     extproc(*Java 
d                                     :'my.package.name.MyClass'
d                                     :'methodName') 
d                                     static 
d  parm1                             like(javaString) 
d  parm2                             like(javaString) 
d new_String      pr                  like(jString) 
d                                     extproc(*JAVA 
d                                     :'java.lang.String'
d                                     :*CONSTRUCTOR) 
d create_from                 1024A   varying const 
d getBytes        pr          1024a   varying 
d                                     extproc(*JAVA: 
d                                     'java.lang.String':
d                                     'getBytes') 
...
 /free
 parm1 = new_String('Test1');
 parm2 = new_String('Test2');
 javaString = myclass(parm1:parm2);
 returnValue = getBytes(javaString);
 /end-free

hope I didn't leave anything out...

Shane Cessna
Senior iSeries Programmer
North American Lighting, Inc.
(618) 662-4483 x2776



"Ramprasad" <ramprasad.varadarajan@xxxxxxxxx> 
Sent by: java400-l-bounces@xxxxxxxxxxxx
05/31/2006 04:03 AM
Please respond to
Java Programming on and around the iSeries / AS400 
<java400-l@xxxxxxxxxxxx>


To
"'Java Programming on and around the iSeries / AS400'" 
<java400-l@xxxxxxxxxxxx>, <java101@xxxxxxxxxxxx>
cc

Subject
Calling a Java pgm from RPG







Hi guys,
 
I have a java .class file in /testdir. I want to invoke that class file 
from
RPGILE.
The java pgm accepts 2 parameters and I should get the value back to 
RPGILE
pgm...
Can anyone provide me detailed steps to execute this...?
 
Thanks & Regards,
Ramprasad V
 



The information contained in this electronic message and any attachments 
to this message are intended for the exclusive use of the addressee(s) and 
may contain proprietary, confidential or privileged information. If you 
are not the intended recipient, you should not disseminate, distribute or 
copy this e-mail. Please notify the sender immediately and destroy all 
copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient 
should check this email and any attachments for the presence of viruses. 
The company accepts no liability for any damage caused by any virus 
transmitted by this email.
 
www.wipro.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.