如何在Pentaho水壶中实现数据库连接参数验证 [英] How to implement database connection parameters validation in Pentaho kettle

查看:140
本文介绍了如何在Pentaho水壶中实现数据库连接参数验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种情况,我得到X行数据库名称作为需要连接的参数.我已经成功完成了工作和转换,对作为参数给出的每个数据库名称重复了一个表输入步骤.因此,当这些dbname恰好有效时,所有这些都很好地工作.但是,如果其中一个名称无效(给定名称不存在db),则表输入步骤将失败并显示错误,并且整个工作将停止,而不是继续使用其余有效名称.

I have a case where I get X rows of database names as parameter which I need to connect to. I've succesfully made the job and transformations to repeat a table input step for each database name given as parameter. So this all works nicely when those dbnames happen to be valid. But if one of those names is invalid (db does not exist with given name), then the table input step fails with an error and the whole job stops instead of continuing for the rest of the names that are valid.

所以我想知道是否有一种方法可以验证数据库连接参数是否有效?也许在发现无效的数据库参数时跳过该步骤?

So I'm wondering is there a way to validate whether database connection parameters are valid or not? And maybe skip the step when an invalid database parameters are found?

推荐答案

为您的连接参数化数据库名称,然后使用作业条目以测试连接.我想这将需要两个转换和一个工作的链:

Parameterize the database name for your connection, then use a Check DB Connections job entry to test the the connection. I would imagine that this would require a chain of 2 transformations and 1 job:

  1. 一种转换,它检索数据库并使用 Job Executor 启动每个数据库名称作为参数传递的验证作业.
  2. 验证作业使用检查数据库连接来检查连接.输入,如果成功,则开始新的转换,继续传递数据库名称
  3. 使用参数化连接通过表输入进行最终转换
  4. >
  1. A transformation which retrieves the databases and use a Job Executor to launch a validation job with each database name passed as a parameter.
  2. A validation job checks the connection with a Check DB Connections entry and, if successful, starts a new transformation, continuing to pass the database name
  3. Final transformation with a Table Input using the parameterized connection

也许可以查看此答案,以获取有关在数据库连接中使用变量的帮助.

Maybe look into this answer for help using variables in DB connections.

祝你好运!

这篇关于如何在Pentaho水壶中实现数据库连接参数验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆