Gets a job from the database.