Symptoms of urinary tract infection usually can not appear within hours of the intercourse.
The symptoms you reported (often urination with constant pain) might indicate neurological disorder. Since the nerves for the uterus and for the bladder muscles originate from very close locations, you might consult urologist or neurologist if some nerve is damaged or pinched, thus causing the frequent and painful urination.
Before that you might want to have a urine culture, to rule out the possible urinary tract infection.