I'm a little confused -- why were you given antibiotics? Did a urinalysis or blood test find something was wrong? As for anxiety, if you suffer from it, it's only a problem when it's chronic. Everyone is afraid of something. Anxious people are afraid irrationally and chronically. So if you just get nervous from something, that's not the mental disorder we call anxiety -- the latter is a chronic problem that gets in the way of our lives, not something that only happens on occasion because something difficult to deal with happened. In your case, It's hard to know what you're describing and hard to see why you would have been given an antibiotic, given they can cause problems of their own and the overuse of them can cause problems for the entire human population, unless your doctor found a bacterial infection somewhere. So I'd ask, do you have a chronic and irrational fear of getting sick from having sex, including types of sex that are less likely to cause any problems?
Anxiety can last forever if you have something to be anxious about. In your case it is natural to have anxiety if you have so much pain, however it is not possible from here to tell if your pain exists or is in your head. Both can cause anxiety, so you need to keep working with doctors to make sure the pain really exists and if anything can be done to resolve it.