Kettle端:
Data Grid只是测试数据,目的是把数据传递到记录结果。
Java端:
package com.womai.util;
import org.pentaho.di.core.KettleEnvironment;
import org.pentaho.di.core.RowMetaAndData;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.TransMeta;
import java.util.List;
public class KettleTest {
public static void main(String[] args){
String filename="e:/test.ktr";
try{
KettleEnvironment.init();
TransMeta transMeta=new TransMeta(filename);
Trans trans=new Trans(transMeta);
trans.execute(null);
trans.waitUntilFinished();
List list = trans.getResultRows();
System.out.println("----------------------分割线-----------------------");
for(int i=0;i
System.out.println(list.get(i));
}
}catch (Exception e){
e.printStackTrace();
}
}
}