From derby-user-return-14591-apmail-db-derby-user-archive=db.apache.org@db.apache.org Tue Sep 4 15:53:14 2012 Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0B7A8D8C7 for ; Tue, 4 Sep 2012 15:53:14 +0000 (UTC) Received: (qmail 68642 invoked by uid 500); 4 Sep 2012 15:53:13 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 68614 invoked by uid 500); 4 Sep 2012 15:53:13 -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 68607 invoked by uid 99); 4 Sep 2012 15:53:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2012 15:53:13 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [66.94.237.213] (HELO nm12.access.bullet.mail.mud.yahoo.com) (66.94.237.213) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 04 Sep 2012 15:53:03 +0000 Received: from [66.94.237.196] by nm12.access.bullet.mail.mud.yahoo.com with NNFMP; 04 Sep 2012 15:52:41 -0000 Received: from [98.139.221.52] by tm7.access.bullet.mail.mud.yahoo.com with NNFMP; 04 Sep 2012 15:52:41 -0000 Received: from [127.0.0.1] by smtp105.sbc.mail.bf1.yahoo.com with NNFMP; 04 Sep 2012 15:52:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s1024; t=1346773961; bh=aAQOt5JJOC9KvYsg5DYQHhAMdSIcbSdCK9uBzwUTUuU=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type; b=T2YN7C6lhycEMmEm2GyCeL+W/KGbRykKybCpt6N9+A8rouZVLVlZW03KFzIX0MZ/+WTX8IMj17tlh5FS38HQA1VMRtxaexIQ7NZ4wlL4FsByxsFqz7nlrB8TBBqDw5vx1NhWriSycrDDcy/iRZqC3jpEpukyUJiN6O2mKRtpupY= X-Yahoo-Newman-Id: 501425.95098.bm@smtp105.sbc.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: q_u3uKsVM1kubLOtglPxXWLzJUWp7XyV5jM2ttyWSOA5p5z KRXLYDUm9iQ.iwuFquBZUT03dcxkc3dmBVY4DcMU51ffDyWCfZMdwHItyTsF BMMAZfZEi48bjVHTSTR2Sa._04tSR85pD3naWQoCqs0BTl8CEoJLhpwjTF3s plbJyDQ68TVBStQTx0C11P66vi7JPt95Y68O07FVHOt3nEikSlt9lXIcyV_1 SeewY8j9H672fk4qLHNSLdPW1ajo7xwmB.4LDbBAeCbHpNkmX6Pu0V2CkwE5 FfVdWb5unBKmS8W0iORhiXR..9cbuct.JxwY.GIPwN6TvPGUh8D06pRW2Qi_ 5ujWfdp_kDsSmsEWrIx.Uuxp6jLiymJ5MnGy.gXNip.n7Q33ifhorzIn.BgW Br4akO8TBxbk.bVxUEZ12OOIDYLfsOwB0gtyL8wniM8tUO8rfIjVGmOLoCpf sM75BZPy..z.cmfRx9tm1vh0V8QtLn6HPJIC2kv8uvQ-- X-Yahoo-SMTP: fBd8VESswBBwVkX.d9lIdXduzED_6kJxUAzIjM21tL._95FbORG0yg-- Received: from [192.168.1.71] (kmarsdenderby@108.231.78.45 with plain) by smtp105.sbc.mail.bf1.yahoo.com with SMTP; 04 Sep 2012 08:52:40 -0700 PDT Message-ID: <504623C6.8010900@sbcglobal.net> Date: Tue, 04 Sep 2012 08:52:38 -0700 From: Katherine Marsden User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Derby Discussion Subject: Re: derby db not found References: <5045FE44.3070804@oracle.com> In-Reply-To: <5045FE44.3070804@oracle.com> Content-Type: multipart/alternative; boundary="------------030903040307090209060302" This is a multi-part message in MIME format. --------------030903040307090209060302 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 9/4/2012 6:12 AM, Kristian Waagan wrote: > On 04.09.2012 00:33, Rainier Diaz Ferrer wrote: >> Hello Derby team, my name is Rainier, i'm having problems trying to >> connect to my derby database using network server. I set the derby >> home directory by using this. System.setproperty("derby.system.home", >> mylocalpathtoderbydb); this code line goes right before starting the >> server. When i try to connect it throws a database not found >> exception, if i copy the database to the current directory, where my >> application is executing from, it works fine, but i want it to find >> my database somewhere else, which is in mylocalpathtoderbydb, set as >> derby.system.home. i would appreciate an answer. Thank you. Rainier > > Hi Rainier, > > Depending on how the driver is loaded, the property may be set too late. > You can try to set the property as a system property on the command > line, or to specify it in derby.properties in your current working > directory to verify that theory. > Are you starting Network Server with the NetworkServerControlControl API in the same JVM? If so, I believe as a work around you can deregister the autoloaded driver by shutting down Derby, e.g. DriverManager.getConnection("jdbc:derby:;shutdown=true") and then set your system property and restart Derby with /Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance()/. If you are launching a separate process, pass the system property on the command line as Kristian suggests. > > Regards, > -- > Kristian --------------030903040307090209060302 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 9/4/2012 6:12 AM, Kristian Waagan wrote:
On 04.09.2012 00:33, Rainier Diaz Ferrer wrote:
Hello Derby team, my name is Rainier, i'm having problems trying to connect to my derby database using network server. I set the derby home directory by using this. System.setproperty("derby.system.home", mylocalpathtoderbydb); this code line goes right before starting the server. When i try to connect it throws a database not found exception, if i copy the database to the current directory, where my application is executing from, it works fine, but i want it to find my database somewhere else,  which is in mylocalpathtoderbydb, set as derby.system.home. i would appreciate an answer. Thank you. Rainier

Hi Rainier,

Depending on how the driver is loaded, the property may be set too late.
You can try to set the property as a system property on the command line, or to specify it in derby.properties in your current working directory to verify that theory.

Are you starting Network Server with the NetworkServerControlControl API in the same JVM? If so,

I believe as a work around  you can deregister the autoloaded driver by shutting down Derby, e.g.
DriverManager.getConnection("jdbc:derby:;shutdown=true")  and then set your system property and restart Derby with Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance().

If you are launching a separate process, pass the system property on the command line as Kristian suggests.



Regards,
--
Kristian

--------------030903040307090209060302--