Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2007
    Posts
    8

    Question Unanswered: Stored Procedure + reason code "1". SQLSTATE=42724

    Hello,

    I have the below problem

    I have the below java file called procedure1.java

    import java.sql.*;

    public class procedure1 {

    public static void procedure1(int[] var0) throws SQLException, Exception {
    // Get connection to the database
    Connection con = DriverManager.getConnection("jdbc:default:connecti on");
    PreparedStatement stmt = null;
    String sql;

    if (con != null)
    con.close();

    // Set return parameter
    var0[0] = var0[0];
    }
    }

    I then create this and put in into a path where the CLASS Variable is present, then I do the below

    That is create a stored procedure

    CREATE PROCEDURE DB2ADMIN.PROC1(OUT var1 INTEGER) LANGUAGE JAVA PARAMETER STYLE JAVA READS SQL DATA FENCED EXTERNAL NAME 'procedure1.procedure1'

    The I call the stored procedure

    db2 call db2admin.proc1(?)

    And it gives me the error

    SQL4304N Java stored procedure or user-defined function "DB2ADMIN.PROC1", specific name "SQL070621173428700" could not load Java class "procedure1",reason code "1". SQLSTATE=42724

    It works on an other system of mine but not on this system and I am not able to figure it out.

    Could someone help me here ?

    The machine I have is a Windows XP machine with SP2.

    Ashok

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Here is an article describing typical problems with Java procedures and how to fix those: http://www.ibm.com/developerworks/db...le/dm-0510law/

    You said:
    I then create this and put in into a path where the CLASS Variable is present, then I do the below
    What do you mean by that? What did you create and how and where did you copy the CLASS file to?
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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