Tim Troup wrote:
> 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

Hi, Tim,

The developer's guide has the information you're looking for:
   http://db.apache.org/derby/docs/10.2/devguide/cdevdeploy30736.html

There are two separate steps:

1) install the jar
   http://db.apache.org/derby/docs/10.2/devguide/cdevdeploy23812.html

2)set derby.database.classpath
   http://db.apache.org/derby/docs/10.2/devguide/cdevdeploy21645.html

The Wiki also includes an example of installing a jar and setting
derby.database.classpath:

   http://wiki.apache.org/db-derby/DerbySQLroutines

regards,

 -jean


> 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
>>
> 

Reply via email to