test database connection before returning native db instance