db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Eggers <mdegg...@gmail.com>
Subject Re: problem with embedded driver
Date Tue, 19 Apr 2011 20:46:05 GMT
On Tue, 19 Apr 2011 12:45:54 -0700, steve lescure wrote:

> String dbName = "//localhost:1527/users";

This is a connection to the network server. If you don't start the 
database prior to running your program, there will be no connection.

If you're using the embedded driver, the database name is just the name 
of the database (users, in your case).

Now the next problem is that with NetBeans, the database gets created in 
a strange spot - $HOME/.netbeans-derby by default. Probably the easiest 
way to run this program is by passing a value for the derby.system.home 
property. This tells Derby where to look for databases when the program 
is started.

By default, the value is ".". This obviously won't work for your code, 
since you used NetBeans to create the database. However, setting this in 
NetBeans is pretty easy.

1. Right-mouse click on your project and select Properties
2. In the dialog box, click on the Run item
3. Add the following to your VM Options:

-Dderby.system.home=$HOME/.netbeans-derby

You might have to replace $HOME with the full path, depending on how 
NetBeans handles environment variables.

Now the program will run from within NetBeans. When you run this from the 
command line (in the dist folder of your project), use the following 
syntax.

java -Dderby.system.home=$HOME/.netbeans-derby -jar YourApp.jar

Hope this helps.

. . . . just my two cents.

/mde/


Mime
View raw message