java - How do I set my Jasper Report JDBC URL relative to the location of the application? -


i want connect database, location of database same folder (dist) jar file. folder not in same location on every computer, , have program set accessible on network. (that's why put database in same folder jar file begin with.)

i need know how connect database url relative database's location. can't use jdbc:h2:./giftcertificatemanagerdatabase;auto_server=true because thinks i'm searching database in "c:/program files/netbeans 8.0". how fix problem?

as always, thank in advance helpful answers.

you can use java find out current working directory, there's plenty of examples online:

return new file("").getabsolutefile(); 

for instance. case in "c:/program files/netbeans 8.0" specific when developing under netbeans , running project there, can set flag use while in "development mode" searches fixed development database folder.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -