问题
I have created a Derby Embeded DB in netbeans. Now I can not find the folder in which DB is placed by netbeans.
My connection URL is jdbc:derby:Inventory;create=true;
.
Where does netbeans place the DB file by default?
I am using Ubuntu 12.04.
回答1:
The Default Linux Netbeans Database Folder :
/home/username/.netbeans-derby/
there is a folder Inventory
netbeans 7.2.1 :
/home/username/.netbeans/7.2.1/derby/
you can search with
sudo find / -name Inventory -print
Properties :
right click Java DB
select Create Database.
回答2:
The database name "Inventory" is a relative name, so it will be located in the "Inventory" subdirectory of the Derby home directory. The Derby home directory defaults to the current working directory when your program runs. So you just have to figure out where the current working directory is when your program runs.
However, this is rather the hard way to go about things. Instead, change your connection URL so that it specifies an absolute name, such as
jdbc:derby:/home/tariq/myDerbyDBs/Inventory
and then you will easily be able to find your database. (Make sure that you create the '/home/tariq/myDerbyDBs' directory first.)
来源:https://stackoverflow.com/questions/17771832/where-does-netbeans-create-derby-embeded-db