this is circular logic.
the connection file creates the connection to the database.
you can use information from the database to populate the file that will make the connection to the database.
Dynamic connections allows you to specify a different mysql server connection for each domain, but that information needs to be statically entered, it cannot come from the database.
the idea of Dynamic Connections is to dynamically change the connection that will be used based on the Domain in the address bar.