db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajesh Kartha <kar...@Source-Zone.Org>
Subject Re: embedded apache derby on Windows connection URL
Date Fri, 16 Sep 2005 15:21:28 GMT
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

Dyre.Tjeldvoll@Sun.COM wrote:

>The following message is a courtesy copy of an article
>that has been posted to comp.lang.java.databases as well.
>
>supermail99@fastmail.fm 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)
>
>  
>



Mime
View raw message