Java: connectionURL points to local file system, how do I point to my project resources?

Posted on 2012-08-24
Medium Priority
Last Modified: 2012-08-30
Hello Experts,

I created a derby db on my file system. I set my connection string to it. For example:

String connectionURL  = "jdbc:derby:C:\\JAVA\\firstdb";

Once I compile and send my jar file for distribution, my app connection will fail because it points to my local file system... makes sense...

how do I add a derby db to my project resources?
what would the connectionURL  string look like?

I appreciate your help.... in advance, thank you for your suggestions...

Question by:epifanio67
  • 2
LVL 86

Accepted Solution

CEHJ earned 2000 total points
ID: 38331600
Try using a relative path. Of course, that could break if the location from which the app is run and the data store path become out of synch. The only was to prevent that is to use an absolute path

Author Closing Comment

ID: 38349879
I am sorry...
I thought I had closed the question...

Thank you for your help....

LVL 86

Expert Comment

ID: 38349892
np :)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses
Course of the Month5 days, 2 hours left to enroll

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question