Search code examples
oracle-databasejnditalend

talend - specify jndi as datasource


I have a talend job that uses tOracleInput component with connection type of ORACLE CUSTOM. It is working well.

Now, I have a requirement to use jndi as the database connection. Any ideas how can this be achieved?


Solution

  • The answer that I went with is creating my own custom talend component. Because deploying the talend job as a separate package than the actual web application is kind of, let's say, not an ideal solution in our case.

    I have copied the tOracleInput component, and using Talend's component designer, I have added a "Use JNDI" checkbox and "JNDI name" textbox on the component. And modified the javajet files to build the connection from JNDI (InitialContext) using the JNDI name if the checkbox is checked. Else, proceed as usual on tOracleInput codes.

    So, whenever I exported my talend job, I would tick the "Use JNDI" checkbox but if I'm just testing within Talend Studio, I would uncheck it and filled up the database properties will be used.

    Hope this helps future readers.

    Thanks!

    **https://intodata.eu/tag/talend/ I have used the 3 part tutorials (on link above) on how to a build custom component to helped me start