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 Alexander Wallace <aw...@rwmotloc.com> on 2004/11/05 19:40:35 UTC

derby embedded + tomcat dbcp.

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...

Thanks!

Re: derby embedded + tomcat dbcp.

Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
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