From derby-user-return-13149-apmail-db-derby-user-archive=db.apache.org@db.apache.org Tue Oct 05 11:23:41 2010 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 72305 invoked from network); 5 Oct 2010 11:23:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Oct 2010 11:23:41 -0000 Received: (qmail 34741 invoked by uid 500); 5 Oct 2010 11:23:41 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 34509 invoked by uid 500); 5 Oct 2010 11:23:38 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 34502 invoked by uid 99); 5 Oct 2010 11:23:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Oct 2010 11:23:38 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [98.139.52.204] (HELO nm7.bullet.mail.ac4.yahoo.com) (98.139.52.204) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 05 Oct 2010 11:23:31 +0000 Received: from [98.139.52.197] by nm7.bullet.mail.ac4.yahoo.com with NNFMP; 05 Oct 2010 11:23:09 -0000 Received: from [98.139.52.160] by tm10.bullet.mail.ac4.yahoo.com with NNFMP; 05 Oct 2010 11:23:09 -0000 Received: from [127.0.0.1] by omp1043.mail.ac4.yahoo.com with NNFMP; 05 Oct 2010 11:23:09 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 245767.22666.bm@omp1043.mail.ac4.yahoo.com Received: (qmail 36133 invoked by uid 60001); 5 Oct 2010 11:23:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1286277789; bh=UvPH7EG7gShw30wPv9N24KPv/dk19bGA2+Egva4OPp8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=dnM8aC8x8DOD+5U3SP7gr2DmGKXMlDQb89W0fZMD5KQlfmVFkMvhYuDyQqZbz7wXYSO5s+LOpLMVg+XXl7cfHQmw0n76RuSwFqH/Wt3edSLGWGPv9aAfthuFsv+2So7HX4+Z/7+OwbQth7chlcTjkGmP4TNF5D1aNNlv80ArKQY= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ymail.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=jPcQX9ceksUmT+W+A6HLx+nUxOMYVdh7SHBIJ6jEZjp7zeU5HkMoSSXb/fpK0qWah9sMPwI54VWvMx0KZUYxg+sq28zGRi8D+3pkUHyCGyhy40jiHvtn+ph1GOUMgYT+J4SLLKB/arEy+S8n2VR9PFRCiT9oBSCou0rF78wRQbM=; Message-ID: <19747.61070.qm@web59507.mail.ac4.yahoo.com> X-YMail-OSG: Cvc2HGkVM1mAM5KtthqggED5wy.UpCtYKiDlt75zjiW5wR3 AgM5JB_zAc6bV4KsRLROkqe0L7NbxghbkJJmT3qs22sls9N_oWRkZnU5ZMr8 WfGXaMsVc3e3BahLmvKQxTuq_l1ul4mbmVmYKm_WIAZd67X1jycShRrPwlYy y1huhs2sgHtkytiwg9LPe_qdF17H9L0eeVWWB9xBSNZ3E94USZAuF8XhbcU8 5LCwoEgMMXP._bIhQhtTLFGAXFtt1qFMkCAPb8A-- Received: from [122.168.4.180] by web59507.mail.ac4.yahoo.com via HTTP; Tue, 05 Oct 2010 04:23:08 PDT X-Mailer: YahooMailClassic/11.4.9 YahooMailWebService/0.8.106.282862 Date: Tue, 5 Oct 2010 04:23:08 -0700 (PDT) From: Dinesh Bajaj Subject: Re: Error in creating database schema on the fly using ij To: Derby Discussion In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-552767338-1286277788=:61070" --0-552767338-1286277788=:61070 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Thanks for your response. I had completely forgotten about adding the jar to the datbase's classpath = :-(.=20 I will do it and see whether it works or not. Thanks again, Dinesh --- 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 To: derby-user@db.apache.org Date: Tuesday, 5 October, 2010, 1:04 PM Dinesh Bajaj writes: > Hi All,=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 > I am using Derby 10.6.1.0=A0 and am calling ij from my java application > to create a database schema on the fly.=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 > The database contains a jar file and the error reported concerns this > jar file.=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 > The .sql file read by ij contains this command:=A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0=20 >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 > CALL SQLJ.INSTALL_JAR('file:DERBYROUTINES.jar.G1286008959877',=A0 =A0 =A0= =A0=A0 > '"schemaname"."DERBYROUTINES"', 0);=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 > ij doesn't throw any error while executing this line and shows the=A0=A0= =A0 > output as:=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0 > "0 rows inserted/updated/deleted". As a result of executing the line=20 > a jar file named DERBYROUTINES.jar.G1286010997266 is added under the=20 > folder dbname\jar\schemaname\.=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0 >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 > The problem occurs when ij is executing a DDL statement for creating=20 > a trigger that calls the function defined in the jar file. It then=A0=A0= =A0 > reports the error:=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0 >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 > "ERROR 42X51: The class 'accountant.DerbyMethods' does not exist or=A0=20 > is inaccessible. This can happen if the class is not public.=A0 =A0 =A0 = =A0=A0=A0 > ERROR XJ001: Java exception: 'accountant.DerbyMethods:=A0 =A0 =A0 =A0 =A0= =A0 =A0=A0=A0 > java.lang.ClassNotFoundException'."=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=20 > 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?=A0 =A0 =A0= =A0=A0 Hi Dinesh, Did you also add the jar to the database classpath? http://db.apache.org/derby/docs/10.6/devguide/cdevdeploy21645.html --=20 Knut Anders =0A=0A --0-552767338-1286277788=:61070 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks for your response.

I had comple= tely forgotten about adding the jar to the datbase's classpath :-(.
I w= ill do it and see whether it works or not.

Thanks again,
Dinesh
--- On Tue, 5/10/10, Knut Anders Hatlen <knut.hatlen@oracle.= com> wrote:

From: Knut Anders Ha= tlen <knut.hatlen@oracle.com>
Subject: Re: Error in creating datab= ase schema on the fly using ij
To: derby-user@db.apache.org
Date: Tue= sday, 5 October, 2010, 1:04 PM

Dinesh Bajaj= <dinesh.bajaj@ymail.com> writes:

> = Hi All,                   = ;                       &nbs= p;                  
>&= nbsp;                    =                     &nbs= p;                     &n= bsp;    
> I am using Derby 10.6.1.0  and am calling = ij from my java application
> to create a database schema on the fly.=                      = ;        
>          &n= bsp;                     =                      = ;                
> The data= base contains a jar file and the error reported concerns this
> jar file.              &nb= sp;                     &= nbsp;                    =  
>                &nb= sp;                     &= nbsp;                    =          
> The .sql file read by ij conta= ins this command:                &n= bsp;    
>             =                     &nbs= p;                     &n= bsp;            
> CALL SQLJ.INSTALL_J= AR('file:DERBYROUTINES.jar.G1286008959877',       
> '"schemaname"."DERBYROUTINES"', 0);   = ;                     &nb= sp;        
>          =                      = ;                     &nb= sp;                
> ij doe= sn't throw any error while executing this line and shows the  &nb= sp;
> output as:              &nbs= p;                     &n= bsp;                    &= nbsp; 
> "0 rows inserted/updated/deleted". As a result of execu= ting the line
> a jar file named DERBYROUTINES.jar.G1286010997266 is= added under the
> folder dbname\jar\schemaname\.                      &nbs= p;                
>&nbs= p;                     &n= bsp;                     =                      = ;    
> The problem occurs when ij is executing a DDL stat= ement for creating
> a trigger that calls the function defined in th= e jar file. It then   
> reports the error:  &nbs= p;                     &n= bsp;                     =      
>            =                      = ;                                    
> "E= RROR 42X51: The class 'accountant.DerbyMethods' does not exist or  > is inaccessible. This can happen if the class is not public.  &n= bsp;      
> ERROR XJ001: Java exception: 'accoun= tant.DerbyMethods:              &nb= sp;
> java.lang.ClassNotFoundException'."        =                      = ;    
>              &n= bsp;                     =                      = ;            
> I am perplexed when th= e jar has been added to the database, why it is
> still not able to r= ecognize the class defined in the jar file?       

Hi Dinesh,

Did you also add the jar to th= e database classpath?
http://db.apache.org/derby/d= ocs/10.6/devguide/cdevdeploy21645.html

--
Knut Anders

--0-552767338-1286277788=:61070--