Hi All,

I created a Java stored procedure and ran into issue when calling it with iSeries Navigator.

If I put the StoredProc.class file directly inside '/QIBM/UserData/OS400/SQLLib/Function' folder, I received the following error:

SQL State: 42724
Vendor Code: -4304
Message: [SQL4304] Java stored procedure or user-defined function GETIFSCNT, specific name GETIFSCNT could not load Java class StoredProc for reason code 1. Cause . . . . . : The Java class given by the EXTERNAL NAME clause of a CREATE PROCEDURE or CREATE FUNCTION statement could not be loaded. The reason codes and their meanings follow: 1 -- The class was not found on the CLASSPATH. 2 -- The class did not implement the required interface ("com.ibm.db2.app.StoredProc" or "com.ibm.db2.app.UDF") or lacked the Java "public" access flag. 3 -- The default constructor failed or was unavailable. Recovery . . . : Ensure that the compiled ".class" file is installed in the CLASSPATH, for example under "/QIBM/UserData/OS400/SQLLib/Function". Ensure it implements the required Java interfaces and is "public".

If I created a subfolder 'StoredProc' inside the '/QIBM/UserData/OS400/SQLLib/Function' folder and then put the 'StoredProc.class' file inside the subfolder to avoid the classpath issue (suggested by a post in this forum), I received the following error:

SQL State: 42501
Vendor Code: -551
Message: [SQL0551] Not authorized to object StoredProc.getIFSObjCount in /QIBM/UserData/OS400/SQLLib/Function type *N. Cause . . . . . : An operation was attempted on object StoredProc.getIFSObjCount in /QIBM/UserData/OS400/SQLLib/Function type *N. This operation cannot be performed without the required authority. Recovery . . . : Obtain the required authority from either the security officer or the object owner. If you are not authorized to a logical file, obtain the authority to the based-on files of the logical file. Try the operation again.

It is a Java parameter style stored procedure. I checked the parameters and they should be correct. The '/QIBM/UserData/OS400/SQLLib/Function' path was added in the CLASSPATH environment variable (*SYS level). Any suggestion to resolve the issue? Please advise.

Thanks,
Derek


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

This mailing list archive is Copyright 1997-2022 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.