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 Benson Margulies <bi...@gmail.com> on 2009/10/30 13:48:56 UTC

Property/config management for embedded use

I'm embedding derby in a webapp. The requirement to set derby.system.home to
a pathname is giving me small fits. I really wish that derby.properties
could be found by classpath, or that there was some API for setting the home
directory.

Re: Property/config management for embedded use

Posted by Mark Petrovic <ms...@gmail.com>.
I'm approaching the same point in my code as Benson appears to have  
encountered in his.  And in the back of my mind, I'm preparing to code  
the embedded derby instance to use not the file-based version, but the  
network client version.  The idea is to spawn the derby network  
listener on localhost:xxxx in the servlet context start-up listener,  
and use localhost:xxxx as the endpoint of the the JDBC URL, instead of file://-whatever. 
   What this buys you is the servlet can talk to the database, but so  
can command line clients running in a different JVM for admin purposes.

Will this actually work?  I think so.  Are real apps actually coded  
this way, sanely?  I don't know.

Any thoughts?

On Oct 30, 2009, at 6:06 AM, Rick Hillegas wrote:

> Benson Margulies wrote:
>> I'm embedding derby in a webapp. The requirement to set  
>> derby.system.home to a pathname is giving me small fits. I really  
>> wish that derby.properties could be found by classpath, or that  
>> there was some API for setting the home directory.
> Hi Benson,
>
> Can you give us some examples of the frustrating operations and can  
> you propose an API that would be easier for you to use?
>
> Thanks,
> -Rick


Re: Property/config management for embedded use

Posted by Rick Hillegas <Ri...@Sun.COM>.
Benson Margulies wrote:
> I'm embedding derby in a webapp. The requirement to set 
> derby.system.home to a pathname is giving me small fits. I really wish 
> that derby.properties could be found by classpath, or that there was 
> some API for setting the home directory. 
Hi Benson,

Can you give us some examples of the frustrating operations and can you 
propose an API that would be easier for you to use?

Thanks,
-Rick

Re: Property/config management for embedded use

Posted by Daniel John Debrunner <dj...@apache.org>.
Benson Margulies wrote:
> I'm embedding derby in a webapp. The requirement to set 
> derby.system.home to a pathname is giving me small fits. I really wish 
> that derby.properties could be found by classpath, or that there was 
> some API for setting the home directory.

Can you use System.setProperty() to set derby.system.home before Derby 
is started?

Dan.