Thanks for your query,based on the facts that you have posted it appears that you have developed Chronic Prostatitis
Please get and culture and sensitivity of urethral discharge obtained after doing a prostatic massage
done to find out the organisms causing this infection and antibiotics to which they are sensitive to so that you can take appropriate antibiotics to combat infection.
Prostatitis takes long time to get cured hence one needs to take antibiotics for 6-8 weeks,
Ensure to wash your genitals with warm water twice daily
Ensure to avoid sexual encounters till it heals up completely.