Results 1 to 4 of 4
- 08-25-2012, 10:56 PM #1
Member
- Join Date
- Nov 2009
- Posts
- 90
- Rep Power
- 0
deployment problem with Derby database
I have a deployment problem for an app that uses a Derby database.
First, I create a jar file that includes the database: jar cvf MyApp.jar *class MyAppsDatabase/* ...
I then use a jar bundler to create a clickable app. To make the app work, I need to set the Derby property derby.system.home to point to the jar file that includes the database.
With Apple's JarBundler, I can set this property, and the app works beautifully: derby.system.home=$APP_PACKAGE/Contents/Resources/Java/
My problem lies with deployment to Windows machines. I have a bundler called jar2exe, but I cannot figure out how to set this Derby parameter so that the app finds the database when it runs.
Does anyone have any experience with this particular bundler? If so, is there a way to set this Derby parameter?
If not, is there some non-bundler-specific way to do this?
Barring that, is there another Windows-based bundler that permits this Derby parameter to be set?
This is driving me crazy; it seems like such a simple problem.
- 08-26-2012, 05:35 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,608
- Rep Power
- 5
Re: deployment problem with Derby database
Have you tried setting a System property eg
See Changing the system-wide properties programmaticallyJava Code:System.getProperties().setProperty("derby.system.home", "my path");
-
Re: deployment problem with Derby database
- 08-27-2012, 04:47 PM #4
Member
- Join Date
- Nov 2009
- Posts
- 90
- Rep Power
- 0
Re: deployment problem with Derby database
I tried this, but it doesn't work. The problem seems to be with the second argument to setProperty( "derby.system.home", "my path" ). The argument need to point to inside the jar file, where the database resides. I have tried setting it to the current directory, which is presumably where the jar file is when the bundled app is clicked.
I have used the following statement to set the URL for the database:
String connectionURL = "jdbc:derby:jar:(Chem.jar)chemdb"
where Chem.jar is the file where the database is located.
When the app is run, an error message is returned that the database can't be found.
If the database were not part of the jar file, I think this approach would work, but this would complicate the deployment. (I just want a bunch of synthetic organic chemists to be able to click an icon on a desktop and have the app access the underlying database; most don't even know what a command line is.)
Similar Threads
-
Embedded Database : SQLite or Derby Database
By vishnubrett in forum NetBeansReplies: 3Last Post: 03-26-2012, 10:50 AM -
Database connection with derby on server
By idbirohit in forum New To JavaReplies: 0Last Post: 09-23-2011, 10:18 AM -
Derby database problem
By rjain in forum New To JavaReplies: 1Last Post: 09-22-2011, 12:36 PM -
Deploy derby database
By Muaz.Sh in forum NetBeansReplies: 11Last Post: 03-17-2011, 06:02 PM -
Using Derby Database in Netbeans
By DavidG24 in forum New To JavaReplies: 1Last Post: 09-14-2009, 01:29 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks