如何从Netbeans,Java DB(Derby)数据库导出表 [英] How to export table from Netbeans, Java DB (Derby) Database
问题描述
我需要导出一些表的结构,以便可以在其他数据库上轻松地重新创建它们。我尝试使用Grab Structure,但是只有当我尝试在Netbeans中创建新表时,这才似乎有效。有关如何执行此操作的任何想法?
I need to export the structure of some tables so I can easily recreate them on a different database. I tried to use the Grab Structure but this seems to work only if I try to create a new table within Netbeans. Any ideas on how to do this?
推荐答案
导出表结构
在Netbeans中
右键单击表以导出-> Grab Structure
right click a table to export -> Grab Structure
保存文件
- 右键单击表以重新创建->
重新创建表
- 打开刚刚创建的文件
- 选择
编辑表脚本
- right click a table to recreate ->
Recreate Table
- open the file just created
- choose
Edit table script
- 执行Ctrl-a和Ctrl-c。标记全部并复制到剪贴板。
- 以
取消
关闭。
- do a Ctrl-a and Ctrl-c . To mark all and copy to clipboard.
- close with
cancel
.
转到您的数据库文件夹
在此文件夹内将您的 ij
否则找不到数据库。
inside this folder call your ij
otherwise the database can not be found.
connect
和 select
查看是否打开了正确的数据库。
connect
and select
look if the right database is opened.
- connect'jdbc:derby:sample; user = app; password = app';
- 从朋友中选择*;
- 打开记事本并从剪贴板粘贴该结构。
- 以后使用,将其保存到文件中。
- 在这里,我将
FRIENDS
重命名为MYFRIENDS
,以免使我的Friends
- 全选并再次复制。
- 粘贴到
ij
并按输入
- 进行选择以测试是否创建了表
MYFRIENDS
。
- open Notepad and paste the structure from the clipboard.
- for later use save it to file.
- here I renamed
FRIENDS
toMYFRIENDS
to not overwright myFriends
table. - Select all and copy again.
- paste to
ij
and hitenter
- do a select to test if table
MYFRIENDS
is created.
现在我们以 quit关闭
进行测试在Netbeans中,我们再次打开Netbeans。 ij
;
在这里。
Now we close ij
with quit;
to test in Netbeans we open Netbeans again.
And here it is. everything in the right position with the right properties.
这篇关于如何从Netbeans,Java DB(Derby)数据库导出表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!