开发技术:KETTLE JAVA API 开发实战记录

欢迎进入Java社区论坛,与200万技术人员互动交流 >>进入

// OK, if we’re still here: overwrite the current transformation…

return transMeta;

}

catch (Exception e)

{

throw new KettleException(“An unexpected error occurred creating the new transformation”, e);

}

}

/**

* 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

*/

public static void main(String[] args) throws Exception

{

EnvUtil.environmentInit();

// Init the logging…

LogWriter log = LogWriter.getInstance(“TransBuilder.log”, true, LogWriter.LOG_LEVEL_DETAILED);

// Load the Kettle steps & plugins

StepLoader stloader = StepLoader.getInstance();

if (!stloader.read())

{

log.logError(“TransBuilder”, “Error loading Kettle steps & plugins… stopping now!”);

return;

}

// The parameters we want, optionally this can be

String fileName = “NewTrans.xml”;

String transformationName = “Test Transformation”;

String sourceDatabaseName = “source”;

String sourceTableName = “testuser.source_table”;

String sourceFields[] = {

“*”

};

String targetDatabaseName = “target”;

String targetTableName = “testuser.target_table”;

String targetFields[] = {

“*”

};

[1][2][3][4][5][6][7]

朋友,旭日正在升起,每一份付出,

开发技术:KETTLE JAVA API 开发实战记录

相关文章:

你感兴趣的文章:

标签云: