<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reusing tDBConneciton over mutliple Hosts dynamically. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529008#M147969</link>
    <description>&lt;P&gt;Ah looks like you "bind" the row1.values in tFixedFlowInput_2. At least that works for me. Not sure if I can then use this in a tDBConnection but I'll have a play with it. Thanks for the suggestion!&lt;/P&gt;</description>
    <pubDate>Mon, 01 Sep 2025 03:00:33 GMT</pubDate>
    <dc:creator>DougIrwin</dc:creator>
    <dc:date>2025-09-01T03:00:33Z</dc:date>
    <item>
      <title>Reusing tDBConnection over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528606#M147951</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;New to Talend but I've been around a long time with data and coding.&lt;/P&gt;
&lt;P&gt;I need to pull data from a bunch of servers that have a consistent database and table name structure. I've set up a basic tDBConnection-&amp;gt;tDBInput-&amp;gt;tLogRow-&amp;gt;tDBClose prototype that works fine.&lt;/P&gt;
&lt;P&gt;Then I've added a tJava at the very beginning to try to get the Connection as an object, with a view to updating the Host in the Connection dynamically. The aim is to change this to some kind of Iterator, once I've proven this can work.&lt;/P&gt;
&lt;P&gt;Unfortunately I'm not having any luck getting the Connection in the tJava, which throws this at runtime:&lt;/P&gt;
&lt;PRE&gt;Starting job ConnectionTest at 14:38 28/08/2025.&lt;BR /&gt;[statistics] connecting to socket on port 3689&lt;BR /&gt;[statistics] connected&lt;BR /&gt;Exception in component tJava_1 (ConnectionTest)&lt;BR /&gt;java.lang.NullPointerException: Cannot invoke "java.sql.Connection.getMetaData()" because "c" is null&lt;BR /&gt;at xxx.connectiontest_0_1.ConnectionTest.tJava_1Process(ConnectionTest.java:552)&lt;BR /&gt;at xxx.connectiontest_0_1.ConnectionTest.runJobInTOS(ConnectionTest.java:2397)&lt;BR /&gt;at xxx.connectiontest_0_1.ConnectionTest.main(ConnectionTest.java:2035)&lt;BR /&gt;[FATAL] 14:38:56 xxx.connectiontest_0_1.ConnectionTest- tJava_1 Cannot invoke "java.sql.Connection.getMetaData()" because "c" is null&lt;BR /&gt;java.lang.NullPointerException: Cannot invoke "java.sql.Connection.getMetaData()" because "c" is null&lt;BR /&gt;at xxx.connectiontest_0_1.ConnectionTest.tJava_1Process(ConnectionTest.java:552) [classes/:?]&lt;BR /&gt;at xxx.connectiontest_0_1.ConnectionTest.runJobInTOS(ConnectionTest.java:2397) [classes/:?]&lt;BR /&gt;at xxx.connectiontest_0_1.ConnectionTest.main(ConnectionTest.java:2035) [classes/:?]&lt;BR /&gt;[statistics] disconnected&lt;BR /&gt;&lt;BR /&gt;Job ConnectionTest ended at 14:38 28/08/2025. [Exit code = 1]&lt;/PRE&gt;
&lt;P&gt;See attachment for what I have, which is working so long as the tJava is disabled.&lt;/P&gt;
&lt;P&gt;Any suggestions would be gratefully received.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 02:58:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528606#M147951</guid>
      <dc:creator>DougIrwin</dc:creator>
      <dc:date>2025-09-01T02:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing tDBConneciton over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528609#M147952</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You may define the Host as a context variable and set this context variable in a tJava or any other way ..&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Denis_Segard_0-1756360185078.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183180iD277731F076E625B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Denis_Segard_0-1756360185078.png" alt="Denis_Segard_0-1756360185078.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;BR /&gt;Denis&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 05:49:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528609#M147952</guid>
      <dc:creator>Denis_Segard</dc:creator>
      <dc:date>2025-08-28T05:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing tDBConneciton over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528611#M147953</link>
      <description>&lt;P&gt;Hey Denis!&lt;/P&gt;
&lt;P&gt;So I got the email about your reply and created a context.hostName, setting it to an initial value and updating my tDBConneciton object to use that. Running that worked, so I modified the tJava to change context.hostName to a different server. That worked perfectly!&lt;/P&gt;
&lt;P&gt;Thanks so much for the tip! Now to get an iterator and list and etc, etc &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 05:58:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528611#M147953</guid>
      <dc:creator>DougIrwin</dc:creator>
      <dc:date>2025-08-28T05:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing tDBConneciton over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528770#M147958</link>
      <description>&lt;P&gt;One thing I just noticed with this solution is that it doesn't work well with parallel execution - I assume because context variables are global. Does anyone know if there's a way to do this that would work with parallel execution?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 23:13:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528770#M147958</guid>
      <dc:creator>DougIrwin</dc:creator>
      <dc:date>2025-08-28T23:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing tDBConneciton over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528839#M147964</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/348736"&gt;@DougIrwin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't know how you set up your parallelism, but try this design maybe it will help you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dave_Simo_0-1756471486832.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183239iEDD070529F6709A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dave_Simo_0-1756471486832.png" alt="Dave_Simo_0-1756471486832.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;With 2 parallel executions for example.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dave_Simo_1-1756471579346.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183240i402FA22FD79FB8D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dave_Simo_1-1756471579346.png" alt="Dave_Simo_1-1756471579346.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 12:47:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2528839#M147964</guid>
      <dc:creator>Dave_Simo</dc:creator>
      <dc:date>2025-08-29T12:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing tDBConneciton over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529004#M147968</link>
      <description>&lt;P&gt;I seem to be missing something. How is your tFixedFlowInput_2 picking up the data from tFlowToIterate_1 to display in the tLogRow ??&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 01:19:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529004#M147968</guid>
      <dc:creator>DougIrwin</dc:creator>
      <dc:date>2025-09-01T01:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing tDBConneciton over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529008#M147969</link>
      <description>&lt;P&gt;Ah looks like you "bind" the row1.values in tFixedFlowInput_2. At least that works for me. Not sure if I can then use this in a tDBConnection but I'll have a play with it. Thanks for the suggestion!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 03:00:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529008#M147969</guid>
      <dc:creator>DougIrwin</dc:creator>
      <dc:date>2025-09-01T03:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing tDBConneciton over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529024#M147970</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/348736"&gt;@DougIrwin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes in tFixedFlowInput_2 I linked it with row1.values.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dave_Simo_0-1756711023301.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183276i62C7DF0C62182282/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dave_Simo_0-1756711023301.png" alt="Dave_Simo_0-1756711023301.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And as input I have this in tFixedFlowInput_1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dave_Simo_1-1756711089933.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183277i6E9A23E210252DF3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dave_Simo_1-1756711089933.png" alt="Dave_Simo_1-1756711089933.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 07:19:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529024#M147970</guid>
      <dc:creator>Dave_Simo</dc:creator>
      <dc:date>2025-09-01T07:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing tDBConneciton over mutliple Hosts dynamically.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529112#M147972</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/274551"&gt;@Dave_Simo&lt;/a&gt;&amp;nbsp;that's essentially the same as what I have - the only difference being my column names. Works a charm, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 23:19:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reusing-tDBConnection-over-mutliple-Hosts-dynamically/m-p/2529112#M147972</guid>
      <dc:creator>DougIrwin</dc:creator>
      <dc:date>2025-09-01T23:19:06Z</dc:date>
    </item>
  </channel>
</rss>

