Runtime selection of Database

Hi,

I have created an application in which I would like to select database
runtime. Actually I have created numbers of subdomains and as per the
subdomain the database should be selected on the conditional base
whatever the domain name is received in url . In short as per the
domain the database should be connected in mysql. Please suggest me
the possible way to overcome this problem.

Thanks in Advance

Parsoya Rakesh