My understanding would think diet change could work. But only if you manage to starve the bacteria. Anti biotics are much more straight forward and effective here. Obviously finish your dose.
That said, I've never had an ulcer, so have not actually read much. Other than finding it was none of the root causes I heard growing up.