Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 92455 invoked from network); 2 Feb 2006 05:34:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Feb 2006 05:34:28 -0000 Received: (qmail 77322 invoked by uid 500); 2 Feb 2006 05:34:26 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 77297 invoked by uid 500); 2 Feb 2006 05:34:26 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 77286 invoked by uid 99); 2 Feb 2006 05:34:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2006 21:34:26 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of afkham@gmail.com designates 64.233.184.205 as permitted sender) Received: from [64.233.184.205] (HELO wproxy.gmail.com) (64.233.184.205) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2006 21:34:25 -0800 Received: by wproxy.gmail.com with SMTP id i11so519687wra for ; Wed, 01 Feb 2006 21:34:04 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qLXE4p4ThgxnivaR6C03sjg+PvpXy0yDAsTPuEFZWMsuZMPFbgIdZlgaV1LoE6wuhL6cHGxb5qI22yis0gDWLL9q5Tb2mmfN3Vq+juWgzT1/v+ZHciXCdTt6j3WPoUgHl2W3LivDFv29yr+/4uOV+3Hgy9N8vOn9sJyOw7HWDmM= Received: by 10.64.232.5 with SMTP id e5mr183454qbh; Wed, 01 Feb 2006 21:34:04 -0800 (PST) Received: by 10.65.253.20 with HTTP; Wed, 1 Feb 2006 21:34:04 -0800 (PST) Message-ID: <9b85c45f0602012134g34b709d8k81ff74804fb9d09b@mail.gmail.com> Date: Thu, 2 Feb 2006 11:34:04 +0600 From: Afkham Azeez To: Derby Discussion Subject: Re: Specifying the Derby Database Location In-Reply-To: <43E1031F.5020903@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <9b85c45f0601312126p4fb1ed82qb33ec9dc0f776f06@mail.gmail.com> <43E0F734.1090202@gmail.com> <43E1031F.5020903@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Folks, Thanks for all the replies, Let me simplify my question: I need to have my database and derby.properties file under different directories, and the derby.system.home points to the directory which contains the derby.properties file. And I need to use the relative path of the DB since, the Database URL is hardcoded in an XML file(I'm using an Object Relational Mapping). Is this achievable? Thanks in Advance Azeez On 2/2/06, Daniel John Debrunner wrote: > Manjula G Kutty wrote: > > > 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? > > This is a good candidate for a Derby FAQ. > > Database names in Derby are more than a single word, they are URL like > in that they can include the URL path separator character forward slash '= /'. > > A database name is either relative or absolute. > > An absolute path corresponds to an absolute path on your file system: > > jdbc:derby:/home/fred/databases/projects/cdcollection > > top level folder for the database is > /home/fred/databases/projects/cdcollection > > > jdbc:derby:d:/home/2006/accounts > > top level folder for the database is > d:\home\2006\accounts > > A relative path is relative to the value of the system property > derby.system.home if it is set, otherwise relative the current working > directory of the java virtual machine. > > All these examples are different ways to connect to the cdcollection > database described above, examples on windows would be similar, > including use of the forward slash. > > derby.system.home=3D/home/fred/databases > jdbc:derby:projects/cdcollection > > derby.system.home=3D/home/fred/databases/projects > jdbc:derby:cdcollection > > current working directory =3D /home/fred > jdbc:derby:databases/projects/cdcollection > > current working directory =3D /home/fred/databases/projects > jdbc:derby:cdcollection > > HTH, > Dan. > > > -- Thanks Afkham Azeez