Kevin,

Before starting the database, set the value for "derby.system.home". For example:

System.setProperty("derby.system.home", "/home/derby/"); // Use absolute path here.

When you run tomcat, the value for "user.dir" is set to Tomcat home. This why if you do not specify absolute path the relative path will always start with tomcat home.

Regards,
Imran.

Kevin Wu wrote:

I have a java web application on a virtual host with Tomcat.

I do not want to set my embedded derby database?s home by absolutely path. I hope it can location in the web application?s root directory.

But when I set the URL like this jdbc:derby:DBTest;create=true. The DBTest database always been created in tomcat?s bin directory.

Because I?m not sure the relationship with the host?s tomcat directory and my application location,

I don?t know what could I do, it can easily locate in my own web application.

Reply via email to