Database connection for a single command
using single command database connection.
Following query joins the 5 table
Select * from table_A, table_B, table_C, table_E, table_E
where table_A.id = table_B.id AND
table_A.id = table_C.id AND
table_A.id = table_D.id AND
table_A.id = table_E.id AND
ID is the primary key in table_A and it is foreign key in other table.
or
if u are using more database from same server than no need to many connection for that u just use a single connection to one of database and write a query for fetch data from more than one database as follows
Select db1.*,db2.* from db1.tablename as db1 inner join db2..tablename AS db2
on db1.id = db2.id
where db1 and db2 is database name