kettle API - Scala 调用示例

object TransDemo extends App {

  execTrans(args(0))  // ktr文件的全路径

  def execTrans(fileName: String) {
    KettleEnvironment.init()
    EnvUtil.environmentInit();
    val transMeta = new TransMeta(fileName)
    val trans = new Trans(transMeta)
    trans.execute(null) // you can pass arguments instead of null
    trans.waitUntilFinished();
    if (trans.getErrors > 0) {
      throw new RuntimeException("There were errors during transformation execution")
    }

  }
}


你可能感兴趣的:(java,scala,Kettle,job)