Ensure database connection setup before rendering header