pentaho 报表设计器中的动态数据库连接

Dynamic database connection in pentaho report designer

我是 Pentaho 报表设计器的新手。 我正在使用本地可用的示例数据库生成大量报告。一旦我们转向生产,我将不得不单独更改所有报告数据库连接凭据。有没有办法在一个地方配置数据库连接并在所有报告中使用相同的数据库连接?

您可以设置/编写 JNDI 连接,然后在您的每个报告中使用此连接。

  1. 在报表开发过程中,您可以在PC HOME 位置编写JNDI 连接,如"C:\Users\User\ .pentaho\simple-jndi\default.properties"
  2. 在 pentaho 服务器中部署报告后,您需要使用相同的 JNDI 名称从您的 pentaho 服务器创建相同的 JNDI 连接。 Pentaho 服务器 JNDI 文件位置类似于“D:\pentaho\pentaho-server\pentaho-solutions\system\simple-jndi\jdbc.properties”

Oracle 的示例 JNDI 连接信息:-

oracleAbc/type=javax.sql.DataSource
oracleAbc/driver=oracle.jdbc.driver.OracleDriver
oracleAbc/url=jdbc:oracle:thin:@localhost:1521:chaucerdb
oracleAbc/user=scott
oracleAbc/password=abc3

之后您可以在报告中使用此 ConnectionName 作为您的 JNDI 连接。

如果您需要任何其他帮助,请告诉我。