Here is one example  to connect to a Derby database in Windows:

Connection conn=DriverManager.getConnection("jdbc:derby:c:\\temp\\my new dir\\a temp\\b temp\\spdb");
(The above  also shows directories with spaces)

Hope it helps.

-Rajesh

[EMAIL PROTECTED] wrote:

The following message is a courtesy copy of an article
that has been posted to comp.lang.java.databases as well.

[EMAIL PROTECTED] writes:

I'm having trouble creating a proper Java connection URL for an
embedded apache derby database on Windows. My database folder was
created with ij and is located at

C:\mytestdb

In my program the following line yeilds the error

SQL Exception: Database 'mytestdb' not found.

Connection
conn=DriverManager.getConnection("jdbc:derby:C:///mytestdb");

What is wrong with this URL?

I don't use Windows, but on Linux I can say
getConnection("jdbc:derby:/tmp/foo")

and I think that jdbc:derby:c:/mytestdb will work on windows

See http://db.apache.org/derby/docs/10.1/devguide/
(section Database Connection Examples)

or, if I use the connection string "jdbc:derby:mytestdb", what is the
search path?

It's relative to the property derby.system.home
see http://db.apache.org/derby/docs/10.1/tuning/
(see the section about properties)



Reply via email to