Most recent research suggests that emotional stress will not cause ulcers, although if someone already has ulcers they can be made worse by stress and anxiety. There are "Stress ulcers" but a stress ulcer is when someone undergoes a major medical illness and the sudden influx of stress hormones such as cortisol and other dramatic inflammatory changes induce an ulcer.
Though certainly stress can cause non-ulcer stomach pain. When my nerves are bad I definitely have my stomach churn, loss of appetite. And even with loss of appetite I can still get hunger pangs from that which can be a burning type sensation sometimes. My father has ulcers too, his is from excessive alcohol use, which is also another possible cause, as is chronic steroid treatment.
If the pain went away with prilosec then came back it's a good possibility the problem may be related to your stomach acid, whether it's an ulcer or acid reflux. Two weeks may not be enough treatment for an ulcer which requires usually 4-6 weeks of treatment and GERD may take up to 8 weeks (unless somewhat has chronic or recurrent forms) The idea behind the two week over the counter prilosec is if it's getting worse or returning after two weeks, you need a medical evaluation.
I would advise follow-up with your doctor on this issue.
If the abdominal pain is low, below the belly button, it's unlikely to be an ulcer even if it's a burning sensation. If it's up near the ribcage, then it certainly could be an ulcer or GERD. It could also be hunger pangs from not eating properly, or due to nerves. But yes you should follow-up with your doc specifically for that. They can do a stool test for h. pylori and if that's positive you would need antibiotics in addition to the prilosec.
best of luck to you