How do make a Pentaho DB connection just once and use it across different jobs and transformations?

Viewed 256

I have a large number of transformations and jobs that read data from tables. I do not want to hardcode the URL, rriver, username, and password each time I create a new transformation or job. If the password is changed in the future, I would need to open all these transformations and manually update it. Is there a way to save this information once in a file and use it in all the jobs and transformations?enter image description here

1 Answers

You can mark as Shared the connection, so it's kept in the ~/.kettle/shared.xml file in your home folder. This has some dangers as you can overwrite that information by error, or when moving the connection to another machine, they can have the same shared connection name with other data. Changing the shared connection information doesn't work very well, and you can get mixed the old and new values of the connection shared.

You can combine sharing the connections with using parameters to determine the connection information, so you keep the parameter definitions of your connections in the ~/.kettle/kettle.properties file, this way you avoid problems when changing the connection information.

What I use is an external plugin developed for Pentaho 8.2, to create enviroments to keep my connection variables instead of in the kettle.properties file, the plugin is here: https://github.com/mattcasters/kettle-environment

The plugin will mostly probably work in future and some past versions of Pentaho, but it hasn't been tested on those versions.

Related