You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Sekhar <ko...@gmail.com> on 2012/12/27 13:58:08 UTC
Re: Error in creating database schema on the fly using ij
Dinesh Bajaj <di...@...> writes:
>
>
> 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,Dinesh--- On Tue, 5/10/10, Knut Anders Hatlen <knut.hatlen <at>
oracle.com> wrote:
> From: Knut Anders Hatlen <knut.hatlen-
QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>Subject: Re: Error in creating database
schema on the fly using ijTo: derby-user-
PvNy6fhA98DNLxjTenLetw@public.gmane.orgDate: Tuesday, 5 October, 2010, 1:04
PMDinesh Bajaj <di...@ymail.com> writes:>
Hi All,
>
> > I am
using Derby 10.6.1.0 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?
http://db.apache.org/derby/docs/10.6/devguide/cdevdeploy21645.html-- Knut Anders
>
>
>
>
>
I created User defined Type and loaded the jar file as mentioned above and add
to the derby classpath. Along with that i wrote one StoreProc where IN
parameter is my UDT created earlier. I registered the Store Proc and adding to
classpath. When i wrote JDBC Client to access my SP then i got
ClassNotFoundException for UDT java class. but in derby.log file it is showing
my UDT java class from its classpath jars, though after that it throwing
Exception, is it because JDBC Client is running in different JVM and Derby
Server is running different JVM, if so i think it has to get
ClassCastException. Please help to solve this issue.