Note that there are some explanatory texts on larger screens.

plurals
  1. POstart derby db server and client using java
    primarykey
    data
    text
    <p>I hav made a java application using <strong>Java Swing</strong>. It uses <strong>derby db</strong> for database and host=<strong>localhost</strong>. I am able to <strong>start database</strong> and connect it to my application using command prompt in windows.But to deploy my application want this to happen <strong>automatically</strong> with the help few lines within my java program.I tried executing commands in a .bat file but with it black window of command prompt always remains open which I don't want.So I tried doing this:-</p> <pre><code>Process pserver=Runtime.getRuntime().exec("cmd /c set DERBY_HOME=E:\\db-derby-10.9.1.0-bin"); ProcessBuilder pb = new ProcessBuilder("C:\\Program Files\\Java\\jdk1.6.0_33\\bin\\java", "-jar", "E:\\db-derby-10.9.1.0-bin\\lib\\derbyrun.jar server start"); pserver= pb.start(); pserver=Runtime.getRuntime().exec("cmd /c set DERBY_INSTALL=E:\\db-derby-10.9.1.0-bin"); pserver=Runtime.getRuntime().exec("cmd /c start set CLASSPATH=%DERBY_INSTALL%\\lib\\derbyclient.jar;%DERBY_INSTALL%\\lib\\derbytools.jar;. "); </code></pre> <p>I also tried using API <a href="http://db.apache.org/derby/docs/10.0/manuals/admin/hubprnt14.html" rel="nofollow">http://db.apache.org/derby/docs/10.0/manuals/admin/hubprnt14.html</a>-NetworkServerControl. I am unable to understand what package to import and which all libraries to include.</p> <p>Someone please help me connecting my java application with derby database eitherby API or by using Process and RunTime class or some better method.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload