0

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

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

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

4

1 回答 1

0

多年前,我在 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
于 2021-11-04T15:17:05.260 回答