Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

What is the CHKOBJ equivalent in Java?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is the CHKOBJ equivalent in Java?

    One way is to call the CHKOBJ command using an CommandCall object. Another is to try the ProgramCall object and write a CL wrapper around the CHKOBJ command. A third technique would be to use the fully qualified pathname of the object (MYFILE in MYLIB is /QSYS.LIB/MYLIB.LIB/MYFILE.FILE) and use the File.exists() method in Java. Joe

  • #2
    What is the CHKOBJ equivalent in Java?

    You could create an ILE procedure that executes the CHKOBJ command by using QCMDEXC. Then you could put the procedure in a service program and code it as a native method in java. Then you could call the java native method from where ever in you java application that you need to.

    Comment


    • #3
      What is the CHKOBJ equivalent in Java?

      Philip, I'm trying to understand your approach as I am also writing other service programs in ILE RPG. Can you please provide me with some sample code so I can put things into perspective? I like the idea of using service programs as native methods in java. I just need some help on how to put this together. Thanks in advance.

      Comment


      • #4
        What is the CHKOBJ equivalent in Java?

        I learned this from the book "Java for RPG Programmer's" which can be purchased at this site. Appendix B of the book discusses how to mix RPG with Java. It gives an example of the code you will need in the Appendix. I suggest purchasing or borrowing the book.

        Comment


        • #5
          What is the CHKOBJ equivalent in Java?

          Necqui Teja wrote: > > Philip, > > I'm trying to understand your approach as I am also writing other service programs in ILE RPG. Can you please provide me with some sample code so I can put things into perspective? > > I like the idea of using service programs as native methods in java. > I just need some help on how to put this together. > There is a small but nearly* complete example of an RPG native method and related Java code, in the ILE RPG Programmer's Guide. http://publib.boulder.ibm.com/infoce...HDRCALLNATMETH * It's only "nearly" complete because the RPG part doesn't show the complete module where it defines the file that is used in the native method, and it doesn't show the THREAD(*SERIALIZE) keyword on the H spec.

          Comment


          • #6
            What is the CHKOBJ equivalent in Java?

            How do I check to see if a file exists on the iSeries from a java application? I'm using JT400.jar.

            Comment


            • #7
              What is the CHKOBJ equivalent in Java?

              This is starting to look very exciting and powerful! Thanks for the link. For CHKOBJ I ended up using the CommandCall. It was simple and quick for what I was doing, but for other stuff I'll definitely keep this new technique in mind. Necqui

              Comment

              Working...
              X