Re: Call system API from Java
Pete Helgren <[email protected]>
| Newsgroups | gmane.comp.lang.as400.java |
|---|---|
| Message-ID | <[email protected]> |
Dieter, It will be on IBM i. It's a Java program and I need to call an IBM i API. I was thinking along the lines of JNI, I have done some of that in Windows. I just needed an example to understand a little more about the needed references and libraries (if any). I could do it in ROG is I had to but the Java program was pretty complete...just needed that IBM i API call to finish it. I really don't want to rewrite the thing so I can use RPG to make the API call into a system API. I'll keep poking around. I know I could go the JT400 route but even those API's are wrappers around JNI calls to system services (I think). I saw some code that was using sockets to communicate but I think they were DB routines. Still looking Pete Helgren www.petesworkshop.com GIAC Secure Software Programmer-Java Twitter - Sys_i_Geek IBM_i_Geek On 2/23/2020 1:18 AM, D*B wrote: > <Pete> > Can't seem to find an example of this that doesn't involve using the > jt400 toolkit or PCML. I also thought *I* had written one of these at > one time but can't seem to dig it up. The goal is to make a call to a > system API in Java. Similar, I guess, to the Java API's that wrap > system API's found in JT400 (which must exist but I haven't found a > good example there either) > > > Anyone got something simple? > </Pete> > > Hi Pete, > > what problem do you wan't to solve? If your java code should run on > local AS/400, JNI would be possible. If your java code is coming from > another box, you would have to adress some listener. Anyway you would > have to do some conversions from java data types to binary data > formats, understood by as400 native code. > Some time ago, I was working in a project to develop an as400 plugin > for a java based monitoring software. The alternatives for me were: > installing toolbox locally or installing some java code on the server. > I decided to go the first alternative. > My recommendations from this: > - stay away from PCML and recordFormat ... > - start with wrappers for the toolbox conversions (using the toolbox > classes you could put in every garbage and it will crash trying > converting back) > - encapsulate all toolbox stuff in classes of your own to avoid to > spread it around > examples for dataQ APIs could be found my open source > AppServer4RPG/ArdGate. > For some API examples drop me a private mail. > > Dieter -- This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/java400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/java400-l. Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com