Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
KYildirim1
Contributor
Contributor

"use existing connection" feature in Talend Component Kit

Hello,

I'm currently using the latest version of the Talend Component Kit, and I'm trying to reuse connections created with tDBConnection, but I don't now how to access the connections. Any input would be appreciated, as my code currently creates multiple connections to the same database inside the same components.

Best regards

Kaan

Labels (2)
5 Replies
wwang
Contributor
Contributor

Hi @Kaan Yildirim​ ,

if you mean how to develop a connection component for your connector, you can see the part :

"How to create a reusable connection in Studio" in

https://talend.github.io/component-runtime/main/1.34.0/creating-dataset-datastore.html

 

KYildirim1
Contributor
Contributor
Author

Hey @Wei Wang​ ,

I would like to create a connection to any Database (using tDBConnection) and to use the connection for a generic Component which would then do some magic. My goal is to have a field in the component settings in talend with a dropdown menu where I then can pick the connection (similar to tDBInput etc.).

I will try to follow the Guide, thanks 😊

 

 

MPogorelov1634291005
Contributor II
Contributor II

Up. I have the same question

Schrauber
Contributor
Contributor

OK, I got it working. like described here: https://talend.github.io/component-runtime/main/1.47.0/creating-dataset-datastore.html

 

I do now have an extra connection component and on the input component there is a checkbox "use an existing connection" and I can select the Connection component.

 

But if I check "use an existing connection" the connection parameters stay in my input compoent.

I have defined the connection parameters in an DataStore.

So I think they should disappear in Input component, when "use an existing connection" is checked.

 

I thought about using @ActiveIf annotation in my DataSet definition. But what should be the condition for the @ActiveIf?

 

Any Ideas?

Schrauber
Contributor
Contributor

OK, I found the bug in my code.

I had a variable with the same name as a class. This caused this not working like described in the links above.

After fixing this, all works fine.