May have kidney stones, urinary tract infection (UTI), bladder infection, etc.
It can also be a sign of cancer in these areas ...

Best thing to do is bloodwork, vet exam, and (if infection) deal with the appropriate antibiotics.

Won't hurt to give him heavy cephalexin doses (15mg/lb, 3x/day, every 8 hours) ... or heavy TMZ doses (25mg/lb, every 12 hrs) ... until you can get him to the vet ...

Good luck,

Jack