Hi,
Sorry my fault I got my classpath screwed up. Sorted it and now there
are no errors.
Ideally I would like to store the jar file in the database and load
the classes from there. I believe I can do this by setting the
derby.database.classpath property. However, I see no mention of this
property in the tuning derby guide:
http://db.apache.org/derby/docs/dev/tuning/ctunproper22250.html
Thanks, Tim
On 29 Jan 2007, at 22:33, Tim Troup wrote:
Hi,
I have created some stored procedures in Java, compiled the
classes, packaged them in a jar file and added the jar file to my
classpath.
When I try and create a trigger which invokes the stored procedure
I get a ClassNotFound error:
ij> CREATE PROCEDURE CALC_SCORE(
IN COPUBID INTEGER
)
LANGUAGE JAVA PARAMETER STYLE JAVA
NO SQL
EXTERNAL NAME
'uk.ac.ed.med.textmining.procedures.CalcScore.calcScore';
ij> CREATE TRIGGER SCORETRIG
AFTER INSERT ON COPUB
REFERENCING NEW AS COPUB
FOR EACH ROW MODE DB2SQL
CALL CALC_SCORE(COPUB.ID);
ERROR 42X51: The class
'uk.ac.ed.med.textmining.procedures.CalcScore' does not exist or is
inaccessible. This can happen if the class is not public. SQLSTATE:
XJ001: Java exception:
'uk.ac.ed.med.textmining.procedures.CalcScore:
java.lang.ClassNotFoundException'.
How do I make the Java stored procedures available to Derby?
Thanks,
Tim