Where does NetBeans create Derby Embeded DB

谁说胖子不能爱 提交于 2019-12-24 06:19:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!