Apache Derby is a small footprint open source relational database implemented entirely in Java. The server can be run as a Windows Service using FireDaemon Pro, which can start automatically at boot prior to login, start multiple instances of the application, and more. This HOWTO will show you how to set up Apache Derby with FireDaemon Pro. You can also use Fusion to manage FireDaemon services and other Windows services via a web browser.
Apache Derby Setup Under FireDaemon Pro
Download the latest Java Server JRE here. Make sure to download the Server JRE because it is designed to work better on servers.
Java Server JRE doesn't have an installer so extract the contents of the zip somewhere on your hard drive. For the purposes of this HOWTO we will use "C:\Java Server JRE".
Extract the zip someplace on your hard drive. For the purposes of this HOWTO we will use: C:\db-derby-10.10.1.1-bin. The folder name will be different if you're using a different version.
Install FireDaemon Pro into the directory of your choice, typically C:\Program Files\FireDaemon. FireDaemon Pro can be downloaded from here.
Next start the FireDaemon GUI from the desktop shortcut. Click on the "Create a new service definition" button in the toolbar (or type Ctrl+N) and enter the information into the fields as you see below. Adjust the paths to suit your installation. Pay special attention to the Executable and Working Directory.
- Executable: The path to the startNetworkServer.bat file. For the purposes of this HOWTO, the path is C:\db-derby-10.10.1.1-bin\bin\startNetworkServer.bat.
- Working Directory: The directory containing your startNetworkServer.bat file. For the purposes of this HOWTO, the path is C:\db-derby-10.10.1.1-bin\bin.
- Parameters are not needed.
Now click on the Settings tab. If you DON'T want to see Apache Derby running, uncheck the Interact with Desktop check box & select "Hidden" from the "Show Window" dropdown. You must set the job type to "Global" so that child processes are terminated properly when the service is stopped or restarted. You can optionally run the Apache Derby as the user you installed it as. You can change the Process Priority to allocate more CPU time to Apache Derby or specify which CPU or core Apache Derby will run on (in the case of multi-processor, hyperthreaded or multi-core CPUs).
Now click on the Lifecycle tab. Leave "Graceful Shutdown" checked and check "Console Application".
Now click on the Pre / Post-Service tab. Append a new Post-Service Program. This is where we set up Apache Derby to stop gracefully when we shut down the service.
- Executable: The path to the stopNetworkServer.bat file. For the purposes of this HOWTO, the path is C:\db-derby-10.10.1.1-bin\bin\stopNetworkServer.bat.
- Working Directory: The directory containing the stopNetworkServer.bat file. For the purposes of this HOWTO, the path is C:\db-derby-10.10.1.1-bin\bin\stopNetworkServer.bat.
- Execution time: 10000
- Run Program: set it to "Before Event"
Now click on the Install button to install and start Apache Derby!