Search code examples
tomcatjndipentahokettle

Pentaho Kettle using plain old tomcat JNDI


I am using the Community Edition 5.2.0 and am intending to deploy the kettle jars onto Tomcat 7 and then have a set of web services to run transformations.

What I want is to be able to set the JNDI name in the database connection dialog in a Spoon step at design time to one which is in my tomcat server.xml/context.xml. Then at runtime it should just pick it up seemlessly? Not so.

I have spend a few hours doing trial and error to see if I can get this working without success. It's not an option for me to use the simple-jndi folder and jdbc.properties approach due to company policy.

Is there really no way around this?

Thanks in advance..


Solution

  • Answer:

    in server.xml and context.xml global resource, you have to call the datasources with the jdbc convention. i.e. jdbc/MyDB

    When instantiating the kettle runtime - use KettleEnvironment.init(false);

    In spoon, just put the "MyDB" in the jndi database connection.