Hi. I have had a long history of gastointestinal problems.
One possible cause: Irritable Bowel Syndrome. I am very sensitive to different foods and beverages, and stress makes it much worse. Not much you can do really, there are some advice for over the counter products but stress management is the big key (I still haven't seemed to figure out what works for me completely). Check it out.
I had a small ulcer in the past, confirmed by an upper GI series, that was NOT caused by H.pylori. This was more difficult to treat. If you do have an ulcer, or suspected of having one, your doc should test you for H.pylori (simple blood test). Most ulcers are caused by this little guy and is treated with a combination of antibiotics and proton pump inhibitors, usually. I was on both ranitidine and prilosec at different times for quite a bit of time before the ulcer ultimately healed.
I currently have a really irritated stomach lining, confirmed by an upper endoscopy (the pic of my stomach lining wasn't too pretty...really inflammed), which feels like an ulcer. I have to just watch what I eat and drink (no coffee is just TOO hard for me so I limit myself to when I am completely exhausted...somehow I think when I start med school this August that limit is going to increase), and I am taking 40mg of Prilosec 2 times a day. This is quite a bit and i wouldn't recommend it without your doctor's approval.
After all that, my advice would be 1.stress management (you will hear this from your doc over and over, believe me), 2.in times of high stress, really watch what you eat and drink...maybe monitor your intake and you may be able to find something that triggers your GI distress, 3.try not to worry about having an ulcer unless it is confirmed by your doc (you may have an irritated stomach or sensitive to stress, or certain foods/beverages); however, if you do think you may have an ulcer or it something serious, work with your doctor to try to confirm or rule out.