Hi,
Try to run a properly compiled Java procedure from DB2 Development Center encounter the error :
POINT.BCBUPLOADCAMPAIGN - Run started.
POINT.BCBUPLOADCAMPAIGN - Exception occurred while running:
A database manager error occurred.[IBM][CLI Driver][DB2/6000] SQL4304N Java stored procedure or user-defined function "POINT.BCBUPLOADCAMPAIGN", specific name "BCBUPLOADCAMPAIGN" could not load Java class "BCBUPLOADCAMPAIGN", reason code "1". SQLSTATE=42724
POINT.BCBUPLOADCAMPAIGN - Roll back completed successfully.
POINT.BCBUPLOADCAMPAIGN - Run failed.
The Environment is DB2 8.1.4 AIX 5.2.
These are the things I have performed/checked and still cannot resolve this problem:
- Update dbm cfg KEEPFENCED to "No" and db2stop/db2start the db instance
- Run db2 "call sqlj.refresh_classes()" manually even the DB2 Development Center did refresh the class while building it
- Confirm the jar file is located in "/home/devinst1/sqllib/function/jar/POINT/SQL61108053041820.jar
- Confirm CLASSPATH includes /home/devinst1/sqllib/function
- Drop the Java procedure and rebuild many times and the problem still persist
- Moved the jar file or class file to /home/devinst1/sqllib/function from /home/devinst1/sqllib/function/jar/POINT directory
The Java code is :
import java.sql.*; // JDBC classes
import java.math.*;
import java.util.*;
import java.text.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
public class BCBUPLOADCAMPAIGN
{
public static void bCBUploadCampaign(String in_fileName, String[] mark1,
String[] mark2) throws SQLException {
String in_camp_code = "";
String in_comm_code = "";
String in_camp_name = "";
String in_camp_desc = "";
String in_aim = "";
String in_start_date = "";
String in_end_date = "";
String in_target_desc = "";
String sql = "";
String failReason = "";
.......
Below is the SQL statement for CREATE PROCEDURE POINT.BCBUPLOADCAMPAIGN after building the above Java source
CREATE PROCEDURE POINT.BCBUPLOADCAMPAIGN ( IN in_fileName VARCHAR(100),
OUT mark1 VARCHAR(400),
OUT mark2 VARCHAR(400) )
SPECIFIC BCBUPLOADCAMPAIGN
NOT DETERMINISTIC
LANGUAGE JAVA
EXTERNAL NAME 'POINT.SQL61108053041820:BCBUPLOADCAMPAIGN.bCBUplo adCampaign'
FENCED
NOT THREADSAFE
PARAMETER STYLE JAVA
Could someone give me some idea what else I can do to make this work?
Regards
WT