This is pretty straight forward. First of all, build a standalone job that will use context variables to set your database connection, carry out the query and load the data. You probably have this given your description.
Next build another job which will query your db table with your db credentials. Connect a tMySQLInput (with the query) to a tFlowToIterate. Then drag your previous job into this new job. Connect your tFlowToIterate to that job using an "iterate" connector.
Now, if your row connecting your tMySQLInput to the tFlowToIterate is called "row1" and your column names are "dbname" and "dbpassword" (for example), you need to pass those to the job carrying out the work. In that job you should have created some context variables that correspond to those values being passed in. Go to the properties of the child job and set the context variables of the child job to the values returned by your query. To do this you use globalMap variables. These are created by the tFlowToIterate component. given the details of this example, your dbname value can be passed using the code....
((String)globalMap.get("row1.dbname"))
...and....
((String)globalMap.get("row1.dbpassword"))
An example of using tRunJob components (child jobs) can be found here (
https://help.talend.com/search/all?query=tRunJob&content-lang=en).
In this example the inner job will be run for every row returned by the query returning db details.