Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Parameterizing the table node

  1. #1
    Join Date
    Jun 2012
    Posts
    20

    Default Parameterizing the table node

    I have a table output where the connection parameters (HostName, Databasename, port, username and password) are all taken from named parameters. This nicely decouples the transformation from the connection paramenters. However before all this happens, i need to create a new connection (in the GUI from table output) and specify the type of DB (Oracle/MySql etc), and once i choose this, then i can set the hostname, port etc with $ variables.
    My question is can the DB type (Oracle/MySql) itself be parameterized? I have embedded kettle in my java code - and i would like to set DB type, hostname, URL, driver etc in my java code as parameters before invoking kettle.

    thx in advance
    -anish

  2. #2
    Join Date
    Jun 2012
    Posts
    20

    Default

    Ah i did find the solution. For the benefit of others - I created the the connection, right-clicked and choose 'Share'. This create a file called shared.xml in KETTLE_HOME. Now all i have to do is to use this one file in all my transformations. When i need to change the DB or any of the connection parameters i only need to edit this one file.

  3. #3

    Default

    What about using a repository? This is the "official" way for a central connection management.

    About your second point. Choosing "generic database" is a possible way to set all database properties with variables (set the desired driver class name and url).

    Edit;
    There is another way to handle your connections; You can create jndi connections per instance, and connect them inside PDI with just the JNDI name.
    Last edited by MichaelBieri; 08-29-2012 at 04:03 PM.

  4. #4
    Join Date
    Jun 2012
    Posts
    20

    Default

    Thanks Michael for your reply. I am a newbie and am struggling to get my head around your reply.
    1) My transformations and jobs are all in a db based repository and i have no issues in accessing them from within my java code and running them. (I am assuming when you say "repository" you mean the store for all the transformations and jobs).
    2) I like your suggestion of JNDI connections but am struggling on how to go about it. I can create a JNDI connection in java - no issue here. The part that is not clear is how do i tell the table node to use it. i.e in spoon when i click on the 'Table Output' node, the form that shows up asks for Step Name, Connection etc. Are you saying that i put in the JNDI name in connection and it will work? If it does, that will be a cool solution. Will try it out and let you know.

    thx
    -anish

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.