云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > KETTLE+JAVA+API+开发实战记录

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/4 16:05:19

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+开发实战记录 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

else selectSQL+=\ \ selectSQL+=sourceFields[i]+Const.CR; } selectSQL+=\ tii.setSQL(selectSQL); StepLoader steploader = StepLoader.getInstance(); String fromstepid = steploader.getStepPluginID(tii); StepMeta fromstep = new StepMeta

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com