netbeans java db,如何从Netbeans,Java DB(Derby)数据库导出表

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?

解决方案

Export a table structure

In Netbeans

right click a table to export -> Grab Structure

XAYIX.jpg

Save the file

5bN9f.jpg

right click a table to recreate -> Recreate Table

open the file just created

choose Edit table script

kPqiX.jpg

do a Ctrl-a and Ctrl-c . To mark all and copy to clipboard.

close with cancel.

P3uoz.jpg

Important close Netbeans to close all connections ( a disconnect inside Netbeans is not enough)

Go to your Databases folder

raHU1.jpg

inside this folder call your ij

otherwise the database can not be found.

Xgpgr.jpg

connect and select look if the right database is opened.

connect 'jdbc:derby:sample;user=app;password=app';

select * from FRIENDS;

NfXck.jpg

open Notepad and paste the structure from the clipboard.

for later use save it to file.

here I renamed FRIENDS to MYFRIENDS to not overwright my Friends table.

Select all and copy again.

paste to ij and hit enter

do a select to test if table MYFRIENDS is created.

VEtZb.jpg

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.

pW0Rw.jpg

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值