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



Did you find a resolution to your issue?

It sounds like you registered the Java class as a stored procedure before you moved the class file to the IFS folder.

Be sure you have your Java class file in it's proper destination before you register it as a stored procedure.
I implemented a similar setup for a solution that needed to execute sql on a remote server upon a trigger execution.

Also, be sure the folder structure under '/QIBM/UserData/OS400/SQLLib/Function' represents your Java package directive in your class file.
For example if you have "package mypackage.myclassgroup" in your class file, the physical location of the class file should be '/QIBM/UserData/OS400/SQLLib/Function/mypackage/myclassgroup/myfile.class'

Hope this helps!

Jason Abreu
Abreu Innovations, Inc.
jason.abreu@xxxxxxxxxxxxxxxxxxxx
http://www.abreuinnovations.com/

On 9/15/2010 6:10 PM, Derek Chow wrote:
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 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.