Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to connect tContextLoad to tMysqlConnection

Hi all,
I am trying to establish connection from tContextLoad to tMysqlConnection. Before to accomplish the process I have prepared an excel file that contain context variable for the database connection (e.g : host, port, username, database, table, password).
These context will be loaded from tFileInputExcel using tContextLoad. As the context successfully loaded, I try to connect tContextLoad to tMysqlConnection. This is to ensure that I can retrive the data based on the context variable that are stated in excel file without inserting any variables in the tMysqlConnection components. How do I get an automatic default database connection from the context I've loaded without putting anything in tMysqlInput component settings back?
Is this possible? Is there any alternative way to accomplish above processes?
Your help is very much appreciated. Thank you.
Labels (2)
20 Replies
Anonymous
Not applicable
Author

Dear Shong,
Thank You for assisting me for the whole process. Your help are much appreciated. Thank You again.
Anonymous
Not applicable
Author

Dear Shong,
I have another situation where I want to create a connection using configuration file. At tMysqlConnection, I don't want to put any values at all. My intention is to create a database connection that thanks to a file not thanks to Talend.


Regards,
naim
Anonymous
Not applicable
Author

Hi
No, it is impossible to create a db connection from a file. This task have to be done on DB component. As I said, the file can store the db connection information, the job read these data and create db connection on DB component dynamically.
Anonymous
Not applicable
Author

Hi Shong,
Thank you for the information.
I have read the user document about tContextLoad. I just need to clarify what is the use of tContextLoad because I thought that tContextLoad will automatically load variables that I have defined in the config file. But when I want to connect a db; tMysqlConnection, i need to redefine the context variables exactly the same like variables in config file.
Actually, I just couldn't grasp the idea of how contextload is working.
Regards,
naim
Anonymous
Not applicable
Author

Yes, that's what exactly the tContextLoad component do. I think you define the configure the schema correctly. Let's say that you have two context variables in the job, host and dbname, the config file have the contents as below(note that the data format, host is the name of context variable, ":" is column separator, it can be other character, set the corresponding character in Field separator on tFileInputDelimited component):
host:192.168.0.23
dbname:talend
on schema of tFileInputDelimited, add two columns, key and value. // the column name must be key and value.
on tContextLoad, check the box 'print operation', and you will see the detailed load operation on the console during the job execution.
Shong
Anonymous
Not applicable
Author

Hi Shong,

Thank you for the reply.
I understand and have followed through all of your steps mentioned above.Sorry if I'm asking this twice but tContextLoad actually doesn't load visibly, automatically the variables from a file (external) into the Job contexts in Talend isn't it? It's just set and read the variables during Job execution when I check the 'print operation' right? Because in the Job context panel, there is no context variables at all been loaded after I hit run.

Thank You
Regards,
Naim
Anonymous
Not applicable
Author

Hi
Can you email me your job and the file which contains the variable value? I will see what are you doing wrong.
Anonymous
Not applicable
Author

Hi Shong,
Do you have any idea about the job that I have sent through your email?
Regards,
Naim.
Anonymous
Not applicable
Author

Hi Shong,
Do you have any idea about the job that I have sent through your email?
Regards,
Naim.

Hi
Sorry, I did't receive your email yet, can you try it again?
Shong
Anonymous
Not applicable
Author

Hi,
I have sent the job into you email accounts.
Thank you.