I am so relieved to read you got him to the vet.  Urinary tract infections in males can even be fatal if left untreated.  I've had female cats with this type of infection too and it can be painful and cause a lot of distress.

 

Did the vet mention changing his diet?  Unfortunately these type of issues can return.  It may pay to have a contingency plan for getting him to the vet quickly just in case.  Also, I've seen a mobile vet service in my area.  Do you have anything like that where you are?  I've also heard there are some vets who do housecalls.  It's worth looking into that just to cover all bases.

 

When one of my cats had thyroid problems and had to have blood tests and take tablets daily, I set aside some money as a 'vet emergency fund' just in case and would top it up whenever I could.