Exporting Derby database in Netbeans

我们两清 提交于 2019-12-10 02:11:35

问题


I have a project with a derby database in it.

I want to be able to make a backup or export the database so I can give it with the project files to my lecturer.


回答1:


By default, the database resides in your home folder under .netbeans-derby (this folder may be hidden under Windows). Copying this folder will work, but your lecturer will have to "register" this copied location with his IDE. To do this:

  • Under Services, open the Databases node.
  • Right-click on Java DB and select properties.
  • In the Database Location field, enter the path to the copied folder.



回答2:


There are lots of ways to backup and/or export data in a Derby database: here's a link to the docs: http://db.apache.org/derby/docs/10.9/adminguide/cadminparttwo.html

In order to make the backup, you have to find the database data on disk. It will all be located in a single folder/directory; that folder/directory is named using the name of your database. So if your database is jdbc:derby:brydb, look for a folder named 'brydb'.




回答3:


Late, but it may be useful for others:

  1. In Netbeans, start a connection to your database.
  2. Right click on it and select 'Execute command'
  3. Write this: CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'YOURTABLE', 'PATHTODUMPFILE', null, null, null)

Remember to write the name of your table and path between simple quotation marks ' '

More information in http://db.apache.org/derby/docs/10.9/adminguide/radminimport91458.html




回答4:


For 2017 NetBeans.

Let me suggest how to export sql scripts' file(after connection to db). So that,go to

1. Services -> Data base -> link -> Schema ->tables -> MYDB.

2. Rightclick on MYDB and select 'Browse data'. And then click 'execute sql' first icon/button

3. In the list of rows below rightclick any of them, and choose "Show scenario for Create.." Sometimes output/logs window may overlay that list though. In such case close it please.

4. Copypast(cntrl-c,cntrl-v) instruction from popup window to a prepared by you previously txt file

5. Again click any of bottom list's rows. Select all of them by cntrl-a keys' combination. Rightclick and select "Show scenario for INSERT.."

6. Copy instruction from popup window and past/add them to mentioned above txt file

You are done with sql scripts' file.



来源:https://stackoverflow.com/questions/15709779/exporting-derby-database-in-netbeans

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