db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Bradbury <Stan.Bradb...@gmail.com>
Subject Re: Keeping derby.properties and the database files in different directories
Date Wed, 01 Feb 2006 18:12:49 GMT
Afkham Azeez wrote:

>Hi Folks,
>
>I have my derby.properties file in $MY_PROJECT/conf directory. This is
>the directory pointed to by the derby.system.home System property. But
>no my database is getting created under $MY_PROJECT/conf e.g. as
>$MY_PROJECT/conf/DATABASE.
>
>I need my database to be created as $MY_PROJECT/DATABASE. Is there a
>property I can specify in the derby.properties file which will specify
>the physical location of the Database?
>--
>Thanks in Advance
>Afkham Azeez
>
>  
>

You have a couple of options. 
1) If the URL is being specified in a program you can expand $MY_PROJECT 
and use it to construct a fullpath database URL  (e.g. 
DriverManager.getConnection("jdbc:derby:/var/myProjDir/theDB")

2) Otherwise you need to set the properties someway other than using a 
derby.properties file.
Set derby.system.home to the location where you want your databases 
created and set the properties as JVM arguments (e.g. java 
-D<property>=<value>) in a way similar to how you are setting 
derby.system.home.
the properties.  If you are using a Server there is often a .properties 
file that the server loads when it starts.

HTH


Mime
View raw message