I used to suffer from similar pains and it was ongoing for 5 years before a nurse at our college campus was smart enough to draw my blood to have me tested for the H-Pylori (
http://en.wikipedia.org/wiki/Helicobacter_pylori) bacteria. I was a broke student back then so when the results came back positive, she hooked me up with a bunch of free sample packets that did the job to kill the bacteria.
I think it's a 3 step process.
Anti Acid until it heals the lining
Pills to kill the bacteria
and Lastly a set of pills to flush it out.
I recommend getting a blood test to see if this is the case. It's well worth it to check because if it's positive, it's "curable" rather than something you have to learn to live with.