DB2 java stored procedure

DB2 java stored procedure

Post by mrid » Sat, 08 Mar 2003 11:23:05



We are experiencing a very odd problem with java stored procedures
very specific to one machine. We are able to successfully build the
procedure through spb but when we try running the sp we get a
signature error.
SQL4306N  Java stored procedure or user-def
ined function "xxxx", specific name "yyyy" could
 not call Java method "zzzzz", signature "".  SQLSTATE=42724

The odd thing is that this has been working in the past and still does
on most of our individual machines except on this one windows box.

 I do not know which configuration  parameter I should look at if at
all thats where the problem could be. Could it be something to do with
the length of the sp name ?  I know the max length is 18 characters
and we are well below that limit.
Any help in this regard would be highly appreciated. Thanks.

 
 
 

DB2 java stored procedure

Post by John Enok Vollesta » Fri, 14 Mar 2003 18:30:10



> We are experiencing a very odd problem with java stored procedures
> very specific to one machine. We are able to successfully build the
> procedure through spb but when we try running the sp we get a
> signature error.
> SQL4306N  Java stored procedure or user-def
> ined function "xxxx", specific name "yyyy" could
>  not call Java method "zzzzz", signature "".  SQLSTATE=42724

> The odd thing is that this has been working in the past and still does
> on most of our individual machines except on this one windows box.

Have it worked in the past on this specific machine?

Quote:>  I do not know which configuration  parameter I should look at if at
> all thats where the problem could be. Could it be something to do with
> the length of the sp name ?  I know the max length is 18 characters
> and we are well below that limit.
> Any help in this regard would be highly appreciated. Thanks.

If you have changed the code in the function you can try restart the
database or do run the command

db2 "call sqlj.refresh_classes()"

--
John Enok

 
 
 

1. DB2 Java Stored procedures

Hello there,

I have a fair bit of experiance writing JDBC -> Sybase and Trasact SQL
stored procedures. I now have a project involving DB2 and I am trying to
write some stored procedures in  Java. However I am having the following
fairly basic problems:

(I am using DB2 5 Evaluation on NT Sp3, with Jdk1.1.7)

1. I have written a simple stored prodedure and placed it into the
DB2/functions directory. I can then call it from a Java program using
Callable Statement. However, DB2 seems to be caching the class rather
peculiarly. Sometimes I get a really old version of the class being
called, sometimes a newer one, sometimes the latest one. Even if I
delete the class file, the procedure still runs. dropping and recreating
the procedure also doesn't refresh the class. What is the policy for
caching java classes on the server and how can I control it? Obviously
during development, the class will get updated all the time and I want
to ensure that DS2 always uses the latest version. Here is the java code
forthe stored procedure:

import java.sql.*;
import COM.ibm.db2.jdbc.app.*;  // DB2 UDB JDBC classes
import COM.ibm.db2.app.*;       // StoredProc and associated classes

class DB2TestSP extends StoredProc
{
 public void selectEmployees(String psFirstName, String psLastName)
throws Exception {
  set(1, "Charles");
  set(2, "Haughey");

 }
 }

2. What is the correct way to write a Java stored procedure which
returns a result set? I can't find any examples of this and I have tried
a few approaches without success.

Thanks in advance,

Bryan

--
Remove the DONTSPAM to get my email address
Unite For Java! - http://www.javalobby.org

2. VB6 with Access 2000

3. DB2 Java stored procedures privileges

4. Problems using serializable transaction

5. DB2 Java Stored Procedures

6. 2 Queries into 1 Table...How?

7. Calling a Java Stored Procedure from another Java Stored Stored Procedure

8. Gettting SQL0751N trying to call java stored procedure from a java stored procedure

9. SQLJ Java Stored Procedures with DB2 6 on OS/390

10. accessing db2 stored procedure from java

11. Interpreted Java Stored Procedures with DB2 on OS/390

12. Problem: DB2 7.2 Stored Procedure in Java