Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    5

    Unanswered: Run DB2 Java Error - SQL4304N SQLSTATE 42724

    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:
    1. Update dbm cfg KEEPFENCED to "No" and db2stop/db2start the db instance
    2. Run db2 "call sqlj.refresh_classes()" manually even the DB2 Development Center did refresh the class while building it
    3. Confirm the jar file is located in "/home/devinst1/sqllib/function/jar/POINT/SQL61108053041820.jar
    4. Confirm CLASSPATH includes /home/devinst1/sqllib/function
    5. Drop the Java procedure and rebuild many times and the problem still persist
    6. 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by chewwt
    [*]Confirm CLASSPATH includes /home/devinst1/sqllib/function
    Did you check your environment, or that of the fenced user?
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Sep 2005
    Posts
    5
    May I know any specific environment settings that I have to check? Also, how to find out the fenced users?

    I have a few Java stored procedures in the same database. Some can be run while others encounter the same error. I have compared those Java programs that can run and those cannot run. I checked the SQL definition, the location of the Jar etc and see no difference.

    Any help is much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •