Attaching database to an existing connection
all rdms support
Db.table

SQL SERVER
[db].[dbo].[Table]

So you can make a query
SELECT a.col1,b.cl2 FROM db1.table1 a INNER JOIN db1.table1 b ON a.id= b.id

That would get you columns from 2 databases, on one connection.
2 connections make the thing more complicted
MYsql can establish federated tables http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html so that you have scenario 1 again. (that is possible for almost every rdms)
For Postgreslq exists something similar see https://www.postgresql.org/docs/9.3/postgres-fdw.html
Else you can only get the data from connection/Server  1 and compare it to the data received by server 2, by means of a variables
(the syntax differs somewaht from rdms to rdms)