I let let user pick a directory (either via a property or via a file selector) than I set the derby.system.home property programtically like

       System.setProperty("derby.system.home", dbLocation);

The value of dbLocation when you print it is for ex.  C:\Documents and Settings\fred\xyz  (that is the way you should set the value) but when you use the debugger it will of course show up as   C:\\Documents and Settings\\fred\\xyz  

After this value is set I use the URL like   jdbc:derby:myDB;create=true  and the database myDB is created under the given directory.

Hope this helps
B-)

On Thu, Mar 27, 2008 at 2:15 PM, Ricardo Seromenho <a23842@ualg.pt> wrote:
PerfectReign has posted the message above and I am with the same problem.

The question is:
What should be the Database URL ?
like this:
C:\\SOMEWHERE\\
or
C\:\\SOMEWHERE\\
or
C:/SOMEWHERE/

?

Thanks



----------------


Question about Embedded Derby

Click to flag this post

by PerfectReign Jan 30, 2008; 09:33pm :: Rate this Message: - Use ratings to moderate (?)


I have successfully completed the "Building a Java Desktop Datbase
Application" tutorial at:
http://www.netbeans.org/kb/60/java/gui-db.html

Very nice work!


I am now trying to do the same thing only using an Embedded Derby
database.

I am able to create the database (using ij) and then connect to it.
However, when I go to run the app, I get an error in my
CarsAppView.java file.

It is at this line (in grey):

entityManager =
javax.persistence.Persistence.createEntityManagerFactory("jdbc:derby:C:\projects\embeddedCar\CARSDBPU").createEntityManager();


The error message states: "illegal escape character" at each of the
three backslashes.

Since this is non-editable, what can be done?
-- 
========================================================
Ricardo Josť da Silva Seromenho                         
Aluno 23842  Universidade do Algarve, Campus de Gambelas
e-mail: a23842@ualg.pt
web: http://www.deei.fct.ualg.pt/~a23842/