繁体   English   中英

在 pentaho 水壶中的转换之间共享数据库连接

[英]Share Database connections across transformations in pentaho kettle

我想共享用于跨其他转换的转换的数据库连接。

Pentaho Kettle 有可能吗? 如果是,那么如何?

如果不是,除了再次手动定义所有数据库连接之外,是否还有其他解决方法?

多年前我在 pentaho 网站的某个地方找到了这个解决方案,我仍然在使用它。 对于共享数据库连接,我使用目录 ~/.kettle(在我的 HOME 目录中)中名为 shared.xml 的文件。 写入/更改文件后,您必须重新启动 pentaho。 之后,您可以在转换中按 shared.xml 中定义的名称选择数据库连接。

这是一个具有一些基本属性的示例。 我用它作为模板。

<?xml version="1.0" encoding="UTF-8"?>
<sharedobjects>
  <connection>
    <name>name</name>
    <server>server</server> 
    <type>type</type> 
    <access>Native</access>
    <database>database</database>
    <port>1234</port>
    <username>username</username>
    <password>Encrypted ....</password>
    <servername/>
    <data_tablespace/>
    <index_tablespace/>
    <attributes>
      <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
      <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
      <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
      <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
      <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>Y</attribute></attribute>
      <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
      <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
      <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
      <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
      <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  </attributes>
 </connection>   </sharedobjects>

简短说明:

name = choose a name you can identify your database... 
server = localhost or IP address or FQDN
type = POSTGRESQL, MYSQL ... database type
database = the real database name used with CREATE ...
username = must be a known user to the database

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM