MySQL转储到德比 [英] mysql dump into derby

查看:85
本文介绍了MySQL转储到德比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用derby进行日食开发.是否可以从MySQL转储表并以某种方式将其用于derby?我知道ddl& dml对于两个dbms都是不同的,但是我正在寻找一种除转储/导出之外的其他方式.

I'm using derby for development in eclipse. Is it possible to dump a table from MySQL and use it for derby in some way? I know that ddl & dml are different for both dbms but I'm looking for a way, other than dump/export, that would be appropriate.

推荐答案

我可以找到两个选项:如果我正确理解了您的问题,我认为至少有一个可以解决您的问题.

There are two options I can find; if I understand your question correctly, I think at least one will cover what you are looking for.

如果您的焦点是单个表中的数据(或其子集),请使用ij,如

If your focus is the data (or a subset thereof) from a single table, use ij as indicated in the Derby tools documentation (see "Using the bulk import and export procedures"). The data can be extracted from MySQL using intrinsic formatting commands in the required format, which appears to be pretty standard CSV (this would require that you have an appropriate table already existing in your Derby database).

这是来自MySQL论坛的示例:

Here's an example from the MySQL forums:

SELECT a,b,a+b INTO OUTFILE '/tmp/result.text'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM test_table; 

如果您要导入所有内容,则 Apache DdlUtils 将允许从中传输整个架构MySQL转换为Derby.这将不需要Derby中重复的表定义,因为它是DdlUtils导入/导出过程的一部分.

If you want to import everything, Apache DdlUtils will allow the transfer of an entire schema from MySQL to Derby. This would not require the repeated table definition in Derby, as it would come across as part of the import/export process with DdlUtils.

这篇关于MySQL转储到德比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆