You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by gana prasad <ga...@gmail.com> on 2009/09/21 15:48:32 UTC

Reg:Accessing database.jar file using derby10.2.2.0

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"*>

       <Resource name=*"jdbc/derby"* auth=*"Container"
*

        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.

Re: Reg:Accessing database.jar file using derby10.2.2.0

Posted by Francois Orsini <fr...@gmail.com>.
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 <ga...@gmail.com> 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"*>
>
>        <Resource name=*"jdbc/derby"* auth=*"Container"*
>
>         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.
>
>
>
>
>
>
>
>
>