db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kostas Karadamoglou <karadamoglo...@yahoo.gr>
Subject How to start derby netserver within an application
Date Sun, 28 Aug 2005 00:29:27 GMT
Hello all,

I am developing an applicaiton that uses Derby 10.1.1. Since now I start 
the database indepedently from the main application. I use ant to invoke 
the derby net server. Here is one of my targets:

<target name="runCacheDB" description="Start Database">
         <java fork="true" 
classname="org.apache.derby.drda.NetworkServerControl" dir="db" 
             <arg value="start"/>
             <arg value="-h"/>
             <arg value="${db.host}"/>
             <arg value="-p"/>
             <arg value="${db.port}"/>

I am planning to embedd the startup of the database network server 
within the application. I found some references of doing that in 10.1.1 
manual. Here is a sample code:

NetworkServerControl server = new 
             server.start(new PrintWriter(System.out));

The code works fine. but I have two major problems. I would like to 
start the database in a different directory than the current working 
directory. For instance in a subdirectory called "db".

How can I specify this? Which is the best option?

The second problem is that I dont receive ouput messages at the System.out.

Do you know if the start method is used correcly.

Thank you in advance, Kostas.

View raw message