DRY database connection statement