You need to know when to seek medical help. This may be one of those times. "Terrible pain" sounds possibly serious to me. A perforated ulcer is nothing to play with.
Oil of oregano will kill many different strains of bacteria, good and bad. I have been very sucessful in treating stomach pain with turmeric. Turmeric is known to inhibit Helicobater Pylori. When bought at an Indian neighborhood store turmeric is very cheap and fresh. It should be used as a tincture. You can make tons of your own tincture inexpensively using vodka or Everclear.
So, do a websearch for "turmeric" and see what you think.
Once again, seek medical help if there is any possibility that you have a serious problem. Self treatment is not always a good option.
Turmeric and ginger are related. I think of turmeric as ginger on steroids.