db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: Error in creating database schema on the fly using ij
Date Tue, 05 Oct 2010 07:34:16 GMT
Dinesh Bajaj <dinesh.bajaj@ymail.com> 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

View raw message