Connecting to DB

Is it possible to connect to two databases in a single query with different username and passwords?

provide an example pls

Just because your thread got closed in the "Shell Programming and Scripting" area (because it smells like homework, looks like homework, feels like homework and most probably *is* homework) that doesn't mean you can open the same thread here.

Closed because of the homework rule and because we are NOT an interactive man-page replacement.

bakunin