第一范文网 - 专业文章范例文档资料分享平台

KETTLE+JAVA+API+开发实战记录

来源:用户分享 时间:2025/6/29 0:56:33 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

else selectSQL+=\ \

selectSQL+=sourceFields[i]+Const.CR;

}

selectSQL+=\

tii.setSQL(selectSQL);

StepLoader steploader = StepLoader.getInstance();

String fromstepid = steploader.getStepPluginID(tii);

StepMeta fromstep = new StepMeta(log, fromstepid, fromstepname, (StepMetaInterface) tii);

fromstep.setLocation(150, 100);

fromstep.setDraw(true);

fromstep.setDescription(\

+ \

transMeta.addStep(fromstep);

//

// add logic to rename fields

// Use metadata logic in SelectValues, use SelectValueInfo...

//

/* 不必改名或映射 add by chq(www.chq.name) on 2006.07.20

SelectValuesMeta svi = new SelectValuesMeta();

svi.allocate(0, 0, sourceFields.length);

for (int i = 0; i < sourceFields.length; i++)

{

svi.getMetaName()[i] = sourceFields[i];

svi.getMetaRename()[i] = targetFields[i];

}

String selstepname = \

String selstepid = steploader.getStepPluginID(svi);

StepMeta selstep = new StepMeta(log, selstepid, selstepname, (StepMetaInterface) svi);

selstep.setLocation(350, 100);

selstep.setDraw(true);

selstep.setDescription(\

transMeta.addStep(selstep);

TransHopMeta shi = new TransHopMeta(fromstep, selstep);

transMeta.addTransHop(shi);

fromstep = selstep; //设定了新的起点 by chq([link=http://www.chq.name]www.chq.name[/link]) on 2006.07.20

*/

//

// Create the target step...

//

//

// Add the TableOutputMeta step...

//

String tostepname = \

TableOutputMeta toi = new TableOutputMeta();

toi.setDatabase(targetDBInfo);

toi.setTablename(targetTableName);

toi.setCommitSize(200);

toi.setTruncateTable(true);

String tostepid = steploader.getStepPluginID(toi);

StepMeta tostep = new StepMeta(log, tostepid, tostepname, (StepMetaInterface) toi);

tostep.setLocation(550, 100);

tostep.setDraw(true);

tostep.setDescription(\information to table [\+ targetTableName + \on database [\

transMeta.addStep(tostep);

//

// Add a hop between the two steps...

//

TransHopMeta hi = new TransHopMeta(fromstep, tostep);

transMeta.addTransHop(hi);

// OK, if we're still here: overwrite the current transformation...

return transMeta;

}

catch (Exception e)

{

throw new KettleException(%unexpected error occurred creating the new transformation\

}

}

/**

* 1) create a new transformation

* 2) save the transformation as XML file

* 3) generate the SQL for the target table

* 4) Execute the transformation

* 5) drop the target table to make this program repeatable

*

* @param args

*/

搜索更多关于: KETTLE+JAVA+API+开发实战记录 的文档
KETTLE+JAVA+API+开发实战记录.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c3sm2c2gqwv3ef8l93tv2_4.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top