This should be possible. You can try
function seconddb() {
global $seconddb;
$seconddb = new wpdb('Username','password','database name','localhost')
}
add_action('init','seconddb');
in your functions.php.
Then you can fire a query to the new db like $seconddb->get_row( "SELECT * FROM yourtable..." );
instead of $wpdb->get_row()
.