If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Problem with Java stored procedure on iSeries V5R2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-23-03, 14:08
egandone egandone is offline
Registered User
 
Join Date: Oct 2003
Posts: 5
Problem with Java stored procedure on iSeries V5R2

Running DB2 UDB for iSeries V5R2

I am receiving the following error when I try and call a Java stored procedure that I've created:

[SQL4304] Java stored procedure or user-defined function BASIC_PROCS, specific name could not load Java class BasicProcs for reason code 5. 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".

Although, the message does say so I believe "reason code 5" means "Cannot establish default context".

Here are the steps I performed to create the procedure:

1) Created a simple class in the file BasicProcs.java

public class BasicProcs {
public static void empty() throws Exception {
}
}

2) Compiled it to a class file and copied it to "/QIBM/UserData/OS400/SQLLib/Function". Also changed the permissions on the file to 777.

3) Created the stored procedure TEST1.BASIC_PROCS using:

CREATE PROCEDURE TEST1.BASIC_PROCS ( )
LANGUAGE JAVA
SPECIFIC TEST1.BASIC_PROCS
NOT DETERMINISTIC
MODIFIES SQL DATA
CALLED ON NULL INPUT
EXTERNAL NAME 'BasicProcs.empty'
PARAMETER STYLE JAVA ;

4) Called the procedure using: CALL TEST1.BASIC_PROCS() which results in the above error.

Help!!

- Egan
Reply With Quote
  #2 (permalink)  
Old 05-08-09, 05:18
fsoflondon fsoflondon is offline
Registered User
 
Join Date: May 2009
Posts: 1
Hello Egan.

Are you find solution of this problem. I have same problem
Reply With Quote
  #3 (permalink)  
Old 10-09-09, 04:40
heriquet heriquet is offline
Registered User
 
Join Date: Sep 2009
Posts: 1
Same issue for me...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On