Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 31721 invoked from network); 21 Sep 2009 22:06:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Sep 2009 22:06:08 -0000 Received: (qmail 72228 invoked by uid 500); 21 Sep 2009 22:06:08 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 72159 invoked by uid 500); 21 Sep 2009 22:06:08 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 72151 invoked by uid 99); 21 Sep 2009 22:06:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Sep 2009 22:06:08 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of francois.orsini@gmail.com designates 209.85.222.199 as permitted sender) Received: from [209.85.222.199] (HELO mail-pz0-f199.google.com) (209.85.222.199) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Sep 2009 22:05:58 +0000 Received: by pzk37 with SMTP id 37so2750819pzk.25 for ; Mon, 21 Sep 2009 15:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=WeoW5cjEOY/mmB43sLsXupigjg48DFrowCVGJ6Kj1u8=; b=fWJW4WcwwVCNtGGOD9JRvdk0d78FAGAT8sfBfZq3DSP9CqZxjQ/WIgFr3thgVEOZ8n mHizlqy5vrYqFJvml3lANw3iDqeVZku3tU8Ui5QN/IVT8q5P4Ae2Jnzh5QgHhpEC/Cpa t5kR/EFrvHyrL31pIi4z7HpehFfwt98ZjYNQI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MfPBLRYhwpRmp40B4Bx9p6MXT9Rf1/IsZQ0ltAtQqoWoYNznj+7HuKRD/KTDmXZOf0 zhTLDo3VnxtX7F54ZpCwsjVVIS0UY1zu0Zc0fDmsW1bonSwlol6w1QrSGOOgHgRXPo57 hLQC034vPWezv7k+g9xtxfiEJj11ugqg5DKjI= MIME-Version: 1.0 Received: by 10.115.103.29 with SMTP id f29mr237857wam.222.1253570736880; Mon, 21 Sep 2009 15:05:36 -0700 (PDT) In-Reply-To: <511468900909210648y77cd1268o6f739d95b1b7529f@mail.gmail.com> References: <511468900909210648y77cd1268o6f739d95b1b7529f@mail.gmail.com> Date: Mon, 21 Sep 2009 15:05:36 -0700 Message-ID: <7921d3e40909211505o9419025k9433ebaf1bd87daf@mail.gmail.com> Subject: Re: Reg:Accessing database.jar file using derby10.2.2.0 From: Francois Orsini To: derby-dev@db.apache.org Content-Type: multipart/alternative; boundary=0016e64cc4a878fbc404741dae94 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64cc4a878fbc404741dae94 Content-Type: text/plain; charset=ISO-8859-1 Hi Gana, Have you checked file permissions on derby.jar to make sure it is readable by whomever user that is launching tomcat? Also, you could test with putting the jars under tomcat/lib --francois On Mon, Sep 21, 2009 at 6:48 AM, gana prasad wrote: > Hi, > > I am facing the problems while accessing the database jar file using derby > 10.2.2.0. > > I am getting the Exception as below: > * > > " org.apache.tomcat.dbcp.dbcp.SQLNestedException > *: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver' > > at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource( > *BasicDataSource.java:1136*) > > at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection( > *BasicDataSource.java:880*) " > > > > My configuration as shown below: > > Context.xml: > > < > Context crossContext=*"true"*> > > > type=*"javax.sql.DataSource"* driverClassName=* > "org.apache.derby.jdbc.EmbeddedDriver"* > > url=*"jdbc:derby:jar:(c:\CalypsoDemo\database.jar)samples"* > > username=*"xxx"* password=*"xxx"* maxActive=*"20"* maxIdle=*"10"* > > maxWait=*"-1"*/> > > Context> > > > > And in my code i am accessing the database like this: > > Context initContext = *new* InitialContext(); > > Context envContext = (Context)initContext.lookup( > "java:/comp/env"); > > DataSource ds = (DataSource)envContext.lookup( > "jdbc/derby"); > > conn = ds.getConnection(); > > And i have placed the derby jar file in tomcat/common/lib directory. And > database.jar file in my local directory. > > > > What could be the reason for this ? Is there any problem with my > configuration.? > > > > Please help me in this regard, > > > > Thanks in Advance, > > Gana. > > > > > > > > > --0016e64cc4a878fbc404741dae94 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Gana,

Have you checked file permissions on derby.jar to make sure= it is readable by whomever user that is launching tomcat?

Also, you= could test with putting the jars under tomcat/lib

--francois

On Mon, Sep 21, 2009 at 6:48 AM, gana prasad= <gana.mnvs@gma= il.com> wrote:
Hi,
=A0
I am facing the problems while accessing the database jar file using d= erby 10.2.2.0.
=A0
I am getting the Exception as below:

" org.apache.tomcat.dbcp.dbcp.SQLNestedException

=
: Cannot load JDBC driver class 'org= .apache.derby.jdbc.EmbeddedDriver'

at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createData= Source(

BasicDataSource.java:1136)

at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(

= Ba= sicDataSource.java:880) =A0"

=A0

My configuration as shown below:

Context.xml:

=A0=A0=A0=A0=A0=A0=A0 <

Context crossContext=3D"true">

=A0=A0=A0=A0=A0=A0 <Resource name=3D"jd= bc/derby" auth=3D
"Container"

=A0=A0=A0=A0=A0=A0=A0 type=3D"javax.sql.DataSource" driverClassName=3D"org.a= pache.derby.jdbc.EmbeddedDriver"

=A0=A0=A0=A0=A0=A0=A0 url=3D"jdbc:derby:jar:(c:\CalypsoDemo\database.jar)samples&qu= ot;=20

=A0=A0=A0=A0=A0=A0=A0=A0username=3D"xxx" pa= ssword=3D"xxx"<= /i> maxActive=3D<= i>&qu= ot;20" maxIdle=3D"10"

=A0=A0=A0=A0=A0=A0 maxWait=3D"-1"/>

</

Context>

=A0

And in my code i am accessing the= database like this:

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 Context initContext =3D new InitialContext();

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0Con= text envContext =3D (Context)initContext.lookup("java:/comp/env");

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 DataS= ource ds =3D (DataSource)envContext.lookup("jdbc/derby"<= font size=3D"2">);

= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 conn =3D ds.getConnection();

And i have placed the derby jar file in tomcat/common/lib=A0 d= irectory. And database.jar file in my local directory.

=A0

What could be the reason for this= ? Is there any problem with my configuration.?

=A0

Please help me in this regard,

=A0

Thanks in Advance,

Gana.

=A0

=A0

=A0

=A0


--0016e64cc4a878fbc404741dae94--