Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Can I set Database Connection Password as Environmental Variable?

  1. #1

    Question Can I set Database Connection Password as Environmental Variable?

    I have a DB2 database with many instances they have the same password but i have to create individual database connections. I am trying to use Environmental Variables ${password} to replace all of the password. the problem is Every time I restart the kettle (PDI), the environmental variables I set are lost except I opened a old job or transformation, even I did so, the value for environmental variables are still lost.


    I am using files instead of repository.

    If someone can help, it will be much appreciated.

  2. #2
    Join Date
    Nov 2013
    Posts
    10

    Default

    It's strange that "lost environmental variable values". after we know more about how you use environmental variable like ${password}. we may be know that's the problem.

  3. #3
    Join Date
    Nov 2008
    Posts
    777

    Default

    I would stick to using Kettle Variables not Environment Variables. Any variable you define in the .kettle/kettle.properties file located in your "home" directory should be consistently available in all Kettle jobs and transformations. It works that way for me anyway...
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  4. #4
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Quote Originally Posted by zhangwenteng View Post
    the problem is Every time I restart the kettle (PDI), the environmental variables I set are lost
    This is expected behavior.

    Think about your OS environment variables - when you log out and back in again, anything that you set (without adding it to your definitions list) will disappear when you log out and back in again.

    If you want to define a PDI environment variable that will persist across logins, follow darrell.nelson 's advice.
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

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.