[英]How to export table from Netbeans, Java DB (Derby) Database
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. 我尝试使用Grab Structure,但是只有当我尝试在Netbeans中创建新表时,这似乎才起作用。 Any ideas on how to do this? 有关如何执行此操作的任何想法?
Export a table structure 导出表结构
In Netbeans 在Netbeans中
right click a table to export -> Grab Structure
右键单击表以导出-> Grab Structure
Save the file 保存文件
Recreate Table
右键单击表以重新创建-> Recreate Table
Edit table script
选择Edit table script
cancel
. 关闭cancel
。 Go to your Databases folder 转到您的数据库文件夹
inside this folder call your ij
在此文件夹中调用您的ij
otherwise the database can not be found. 否则找不到数据库。
connect
and select
look if the right database is opened. connect
并select
查看是否打开了正确的数据库。
FRIENDS
to MYFRIENDS
to not overwright my Friends
table. 在这里,我将FRIENDS
重命名为MYFRIENDS
,以免覆盖我的Friends
表。 ij
and hit enter
粘贴到ij
并按enter
MYFRIENDS
is created. 选择要测试的表MYFRIENDS
是否已创建。 Now we close ij
with quit;
现在我们以quit;
关闭ij
quit;
to test in Netbeans we open Netbeans again. 为了在Netbeans中进行测试,我们再次打开Netbeans。
And here it is. 在这里。 everything in the right position with the right properties. 具有正确属性的所有位置都正确。
Try using Apache DDLUtils: http://db.apache.org/ddlutils/ . 尝试使用Apache DDLUtils: http ://db.apache.org/ddlutils/。 It can export and import schema from many database implementations (this text added to exceed the minimum answer limit). 它可以从许多数据库实现中导出和导入模式(添加的文本超出了最小答案限制)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.