lorraine batol
lorraine batol

Reputation: 6281

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?

Upvotes: 4

Views: 402

Answers (2)

lorraine batol
lorraine batol

Reputation: 6281

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

Upvotes: 0

Hash
Hash

Reputation: 4715

First deploy your job as a webservice. After that you should be able to alter the Use or register a shared DB Connection in tOracleConnection. There you can define your JNDI datasource.

Source: https://www.talendforge.org/forum/viewtopic.php?pid=50374#p50374

Upvotes: 1

Related Questions