Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

packing derby derby with java application

Thread view: 
Wills - 09 Jul 2007 11:26 GMT
Hi all,
   I have done a java application that requires DBDerby .How can I
supply DB derby with the java application to a customer.Should I
install DB derby in a particular folder where the software requires it
in my customers machine.This is the first time I am doing such an
application.
Thanks in advance.
Andrew Thompson - 09 Jul 2007 11:41 GMT
...
>    I have done a java application that requires DBDerby .How can I
>supply DB derby with the java application to a customer.

Java web start is one way.
Demos <http://www.physci.org/jws/>

>..Should I
>install DB derby in a particular folder where the software requires it
>in my customers machine.

I doubt it is necessary, check the documentation.
If not, simply add the Derby API's into the application's
runtime classpath (in the web start launch file).
Otherwise, you might use a JWS installer* to install
the DB, and set the properties that allows the
application to find it.
<http://www.physci.org/jws/#eis>

Signature

Andrew Thompson
http://www.athompson.info/andrew/

root - 09 Jul 2007 12:10 GMT
> ..
>>    I have done a java application that requires DBDerby .How can I
[quoted text clipped - 14 lines]
> application to find it.
> <http://www.physci.org/jws/#eis>

I have developed a quite complex software with derby embedded into it &
access to data through ejb3 ( toplink

)RUNOPTS="-Dconfig.filename=project.base.xml -Dconfig.location=file
-Dderby.system.home=/home/java/databases"

java $RUNOPTS tibetsoftware.wenmei.core.Main 2>&1 | tee LOG

you can put the derby database folder anywhere you want it to be
simply need to setup some sort of environment like
you can even start the database within java

serverThread srv=new serverThread();
        srv.run();

package tibetsoftware.wenmei.core;

import java.net.UnknownHostException;
import org.apache.derby.drda.NetworkServerControl;

public class serverThread  extends Thread {

    public void start() {
        System.out.println("Starting Server Thread...");
        try {
            NetworkServerControl server = new

            // hostname/port read from derby.properties
            NetworkServerControl();

            // hostname/port as arguments
            //NetworkServerControl(InetAddress.getByName("9.x.x.x"),1527);

            server.start(null);
        } catch (UnknownHostException e) {
            System.out.println("Unkown host error");
            e.printStackTrace();
        } catch (Exception e) {
            System.out.println("Unkown EXCEPTION");
            e.printStackTrace();
        }
    }
    public void run() {
        start();
    }
}

hope that helps
patrick
Wills - 10 Jul 2007 09:48 GMT
> }
>
> hope that helps
> patrick

Hi all,
Thanks for your response.I feel difficult to understand the code.I am
still going through Derby documentation.
Thanks.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.