Thanks for your response.

I had completely forgotten about adding the jar to the datbase's classpath :-(.
I will do it and see whether it works or not.

Thanks again,

--- On Tue, 5/10/10, Knut Anders Hatlen <> wrote:

From: Knut Anders Hatlen <>
Subject: Re: Error in creating database schema on the fly using ij
Date: Tuesday, 5 October, 2010, 1:04 PM

Dinesh Bajaj <> writes:

> Hi All,                                                             
> I am using Derby  and am calling ij from my java application
> to create a database schema on the fly.                             
> The database contains a jar file and the error reported concerns this
> jar file.                                                           
> The .sql file read by ij contains this command:                     
> CALL SQLJ.INSTALL_JAR('file:DERBYROUTINES.jar.G1286008959877',       
> '"schemaname"."DERBYROUTINES"', 0);                                 
> ij doesn't throw any error while executing this line and shows the   
> output as:                                                           
> "0 rows inserted/updated/deleted". As a result of executing the line
> a jar file named DERBYROUTINES.jar.G1286010997266 is added under the
> folder dbname\jar\schemaname\.                                       
> The problem occurs when ij is executing a DDL statement for creating
> a trigger that calls the function defined in the jar file. It then   
> reports the error:                                                   
> "ERROR 42X51: The class 'accountant.DerbyMethods' does not exist or 
> is inaccessible. This can happen if the class is not public.         
> ERROR XJ001: Java exception: 'accountant.DerbyMethods:               
> java.lang.ClassNotFoundException'."                                 
> I am perplexed when the jar has been added to the database, why it is
> still not able to recognize the class defined in the jar file?       

Hi Dinesh,

Did you also add the jar to the database classpath?

Knut Anders