Skip to main content

toplink.jdbc.url can't find local database

1 reply [Last post]
odeno
Offline
Joined: 2009-06-15
Points: 0

Hi,

I'm designing a desktop app with JPA (using netbeans) and I'm trying to work out the deployment side of things. in doing this I want to deploy embedded derby bundled with the app.

Having read around I think the best way to do this is to copy the db to the source jar file so I have:-

app.jar
[derby db]
[lib]

Now in the persistance.xml file, I give the toplink.jdbc.url property the values as shown below:-

The problem I have is the database can't be found when launching the app.jar. if I enter the full path name the db is found. however I want to avoid using the full path name for deployment - everyone's setup will be different.

Anyone know a way of constructing a url to search the current dir for the database?

Only other way i can think of is to use an installer so we always know where the db is and then using the full path name??

thanks,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
odeno
Offline
Joined: 2009-06-15
Points: 0

This is now working.

Not sure why it wasn't before.

In case this is useful info, you can use the System.getProperty/setProperty methods to debug your setup if need be.