<?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 Getting dynamic Database connection info inside a job in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278352#M53863</link>
    <description>I am fetching data from multiple tables(using tMysqlInput ) and putting it into other set of multiple tables(using tMysqlOutput ). For setting database connection information of tMysqlInput and tMysqlOutput I'm using "DB Connections" in Metadata section. 
&lt;BR /&gt;I want to deploy ETL job on Tomcat as WAR. When I start the server my ETL job should get database connection settings from context.xml which may look like: 
&lt;BR /&gt;------------------------------------------------------------------------------------------------------ 
&lt;BR /&gt;&amp;lt;Resource name="jdbc/myDB1" auth="Container" type="javax.sql.DataSource" 
&lt;BR /&gt; 
&lt;BR /&gt; initialSize="10" maxActive="30" maxIdle="15" minIdle="3" maxWait="10000" 
&lt;BR /&gt; suspectTimeout="60" timeBetweenEvictionRunsMillis="30000" minEvictableIdleTimeMillis="60000" testOnBorrow="true" 
&lt;BR /&gt; 
&lt;BR /&gt; validationInterval="3600000" validationQuery="SELECT 1" 
&lt;BR /&gt; driverClassName="com.mysql.jdbc.Driver" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" 
&lt;BR /&gt; 
&lt;BR /&gt; username="root" password="root" url="jdbc:mysql://mydb1"/&amp;gt; 
&lt;BR /&gt;&amp;lt;Resource name="jdbc/myDB2" auth="Container" type="javax.sql.DataSource" 
&lt;BR /&gt; 
&lt;BR /&gt; initialSize="10" maxActive="30" maxIdle="15" minIdle="3" maxWait="10000" 
&lt;BR /&gt; suspectTimeout="60" timeBetweenEvictionRunsMillis="30000" minEvictableIdleTimeMillis="60000" testOnBorrow="true" 
&lt;BR /&gt; 
&lt;BR /&gt; validationInterval="3600000" validationQuery="SELECT 1" 
&lt;BR /&gt; driverClassName="com.mysql.jdbc.Driver" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" 
&lt;BR /&gt; 
&lt;BR /&gt; username="root" password="root" url="jdbc:mysql://mydb2"/&amp;gt; 
&lt;BR /&gt;------------------------------------------------------------------------------------------------------ 
&lt;BR /&gt;Since server location can change. I should only change DB setting in context.xml and my ETL should pick it from there every time it is started. 
&lt;BR /&gt;Kindly help.</description>
    <pubDate>Sat, 16 Nov 2024 13:00:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T13:00:44Z</dc:date>
    <item>
      <title>Getting dynamic Database connection info inside a job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278352#M53863</link>
      <description>I am fetching data from multiple tables(using tMysqlInput ) and putting it into other set of multiple tables(using tMysqlOutput ). For setting database connection information of tMysqlInput and tMysqlOutput I'm using "DB Connections" in Metadata section. 
&lt;BR /&gt;I want to deploy ETL job on Tomcat as WAR. When I start the server my ETL job should get database connection settings from context.xml which may look like: 
&lt;BR /&gt;------------------------------------------------------------------------------------------------------ 
&lt;BR /&gt;&amp;lt;Resource name="jdbc/myDB1" auth="Container" type="javax.sql.DataSource" 
&lt;BR /&gt; 
&lt;BR /&gt; initialSize="10" maxActive="30" maxIdle="15" minIdle="3" maxWait="10000" 
&lt;BR /&gt; suspectTimeout="60" timeBetweenEvictionRunsMillis="30000" minEvictableIdleTimeMillis="60000" testOnBorrow="true" 
&lt;BR /&gt; 
&lt;BR /&gt; validationInterval="3600000" validationQuery="SELECT 1" 
&lt;BR /&gt; driverClassName="com.mysql.jdbc.Driver" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" 
&lt;BR /&gt; 
&lt;BR /&gt; username="root" password="root" url="jdbc:mysql://mydb1"/&amp;gt; 
&lt;BR /&gt;&amp;lt;Resource name="jdbc/myDB2" auth="Container" type="javax.sql.DataSource" 
&lt;BR /&gt; 
&lt;BR /&gt; initialSize="10" maxActive="30" maxIdle="15" minIdle="3" maxWait="10000" 
&lt;BR /&gt; suspectTimeout="60" timeBetweenEvictionRunsMillis="30000" minEvictableIdleTimeMillis="60000" testOnBorrow="true" 
&lt;BR /&gt; 
&lt;BR /&gt; validationInterval="3600000" validationQuery="SELECT 1" 
&lt;BR /&gt; driverClassName="com.mysql.jdbc.Driver" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" 
&lt;BR /&gt; 
&lt;BR /&gt; username="root" password="root" url="jdbc:mysql://mydb2"/&amp;gt; 
&lt;BR /&gt;------------------------------------------------------------------------------------------------------ 
&lt;BR /&gt;Since server location can change. I should only change DB setting in context.xml and my ETL should pick it from there every time it is started. 
&lt;BR /&gt;Kindly help.</description>
      <pubDate>Sat, 16 Nov 2024 13:00:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278352#M53863</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting dynamic Database connection info inside a job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278353#M53864</link>
      <description>take a look at the tContextLoad component. This will allow you to parse your configuration file and populate all the db context variables.</description>
      <pubDate>Mon, 28 Mar 2011 18:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278353#M53864</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-28T18:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Getting dynamic Database connection info inside a job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278354#M53865</link>
      <description>My text file contains entries: 
&lt;BR /&gt;----------------- 
&lt;BR /&gt;host;localhost 
&lt;BR /&gt;port;3306 
&lt;BR /&gt;database;mydb 
&lt;BR /&gt;username;root 
&lt;BR /&gt;password;root 
&lt;BR /&gt;----------------- 
&lt;BR /&gt;I have attached JPG of what I'm doing. tFileInputDelimited is reading the text file. Log is 
&lt;BR /&gt; 
&lt;BR /&gt;----------------------------------------- 
&lt;BR /&gt;Starting job testjob at 13:43 29/03/2011. 
&lt;BR /&gt; connecting to socket on port 3807 
&lt;BR /&gt; connected 
&lt;BR /&gt;2011-03-29 13:43:34|ReZVpL|ReZVpL|ReZVpL|4664|TALENDDEMOSJAVA|testjob|_2N3S8FlAEeCjBbsqNga8JQ|0.1|Default||begin|| 
&lt;BR /&gt;tContextLoad_1 set key "host" with value "localhost" 
&lt;BR /&gt;tContextLoad_1 set key "port" with value "3306" 
&lt;BR /&gt;tContextLoad_1 set key "database" with value "mydb" 
&lt;BR /&gt;tContextLoad_1 set key "username" with value "root" 
&lt;BR /&gt;tContextLoad_1 set key "password" with value "root" 
&lt;BR /&gt;Warning: Parameter "host" is a new parameter of tContextLoad_1 
&lt;BR /&gt;Warning: Parameter "port" is a new parameter of tContextLoad_1 
&lt;BR /&gt;Warning: Parameter "database" is a new parameter of tContextLoad_1 
&lt;BR /&gt;Warning: Parameter "username" is a new parameter of tContextLoad_1 
&lt;BR /&gt;Warning: Parameter "password" is a new parameter of tContextLoad_1 
&lt;BR /&gt;Exception in component tMysqlOutput_1 
&lt;BR /&gt;java.lang.NullPointerException 
&lt;BR /&gt; at talenddemosjava.testjob_0_1.testjob.tMysqlInput_1Process(testjob.java:1208) 
&lt;BR /&gt; at talenddemosjava.testjob_0_1.testjob.tFileInputDelimited_1Process(testjob.java:764) 
&lt;BR /&gt; at talenddemosjava.testjob_0_1.testjob.runJobInTOS(testjob.java:4939) 
&lt;BR /&gt; at talenddemosjava.testjob_0_1.testjob.main(testjob.java:4803) 
&lt;BR /&gt;2011-03-29 13:43:34|ReZVpL|ReZVpL|ReZVpL|4664|TALENDDEMOSJAVA|testjob|_2N3S8FlAEeCjBbsqNga8JQ|0.1|Default||end|failure|130 
&lt;BR /&gt; disconnected 
&lt;BR /&gt;Job testjob ended at 13:43 29/03/2011. 
&lt;BR /&gt;----------------------------------------- 
&lt;BR /&gt;My problem is how to propagate the database connection information from Text file to tMySqlInput's and tMySqlOutput's which are in a long chain. 
&lt;BR /&gt; 
&lt;BR /&gt;I have even tried using tFileInputXML for reading XML file. On running the Job XML data is fetched by the component but is not passed to tMySqlInput. 
&lt;BR /&gt;I need help in passing the database connection information from XML or Text file to a long chain of tMySqlInput's and tMySqlOutput's which ultimately populates a final DataBase. 
&lt;BR /&gt;If someone has used and successfully implemented it can post Basic Setting information,Schema etc info will help me alot. I have read the documentation and know the theory but facing while implementation.</description>
      <pubDate>Tue, 29 Mar 2011 09:39:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278354#M53865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-29T09:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Getting dynamic Database connection info inside a job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278355#M53866</link>
      <description>Hi&lt;BR /&gt;use TJavaRow and manually save your values in the context variable and try.</description>
      <pubDate>Wed, 30 Mar 2011 04:14:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Getting-dynamic-Database-connection-info-inside-a-job/m-p/2278355#M53866</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-30T04:14:40Z</dc:date>
    </item>
  </channel>
</rss>

