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: 
ODridi
Contributor
Contributor

Database parameters

Hello,

Does any one know how to read database parameters from a file instead of filling in the information directly in the tDbInput component ?

thank you

1 Solution

Accepted Solutions
shalinim1
Contributor III
Contributor III

Hi @Ons Dridi​ ​,

 

You can use tContextLoad component to achieve your requirement.

 

The job should flow as tfileInputDelimited ---> tContextLoad ---> onsubjobok ---> tDBInput…

 

tfileInput file should contains the database parameters like,

host;localhost

port;3306

database;test

username;root

password;talend

 

Select the context view of the Job to define the following parameters,

host, String type

port, String type

database, String type

username, String type

password, Password type

 

Then while describing the parameters of tDBInput component,

use--> context.host, context.port, context.database, context.username,

context.password.

 

Hope this would help you.

 

Regards,

Shalini

 

View solution in original post

3 Replies
shalinim1
Contributor III
Contributor III

Hi @Ons Dridi​ ​,

 

You can use tContextLoad component to achieve your requirement.

 

The job should flow as tfileInputDelimited ---> tContextLoad ---> onsubjobok ---> tDBInput…

 

tfileInput file should contains the database parameters like,

host;localhost

port;3306

database;test

username;root

password;talend

 

Select the context view of the Job to define the following parameters,

host, String type

port, String type

database, String type

username, String type

password, Password type

 

Then while describing the parameters of tDBInput component,

use--> context.host, context.port, context.database, context.username,

context.password.

 

Hope this would help you.

 

Regards,

Shalini

 

ODridi
Contributor
Contributor
Author

thank you so much @Shalini M​  , it's very helpful , I tried it and it works !

Anonymous
Not applicable