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 > Stored Procedure + reason code "1". SQLSTATE=42724

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-21-07, 20:52
ASHOKJOSE ASHOKJOSE is offline
Registered User
 
Join Date: Jun 2007
Posts: 8
Question 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
Reply With Quote
  #2 (permalink)  
Old 06-25-07, 06:12
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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:
Quote:
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
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