db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean T. Anderson" <...@bristowhill.com>
Subject Re: derby embedded + tomcat dbcp.
Date Sat, 06 Nov 2004 20:22:42 GMT
Alexander Wallace wrote:

> Anyone here has experience usint tomcat dbcp with derby in embedded
> mode? I'm interested in doing a project with this aproach but there
> are things i'm not sure about, like:
>
> -Where should i put the derby jars? with the app libs or on the common
> libs place?
> -Where is the actuall database directory/files supposed to be placed
>
> If anyone here has done such a thing, i would appreciate if they share
> how this was accomplished...


Check out Lance Bader's developerWorks article
(http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408bader/)
titled
"Integrating Cloudscape and Tomcat: A cookbook for adding the database
manager into the servlet container".

His third scenario ("enterprise") defines a JNDI datasource. There are
two caveats. First, he did this for Cloudscape 5.1 -- he says he's
updating the article for Derby, but doesn't know when he'll finish it.
Second, he uses the network server for this scenario -- but it should
work for embedded as well. What might be of most interest to you is his
Tomcat config information.  (His "casual" scenario work fine with Derby
with a few changes, but it doesn't use the connection pooling you're
interested in.)

For the second question, you can put the database wherever you like,
then reference the complete path to it in the connection url. For
example, I have a database in this physical location on my machine:

  /home/jta/demo/tut

Here's the connection url I use to connect to it:

  jdbc:derby:/home/jta/demo/tut

I hope this helps. If you get it working, please let us all know!

cheers,

 -jean



Mime
View raw message