If your cat is not urinating at all, this is an absolute emergency. His urine can back up into his kidneys and cause renal failure and, if left untreated, can even cause death. Because your cat is still eating and drinking and this has been going on for three weeks, it does not sound like he is completely obstructed or he would be very ill by this time. Nonetheless, if he is straining in the litter box he is likely in quite a bit of pain and discomfort. It is possible your cat could have a bladder stone, feline lower urinary tract disease or a bladder infection. He should he examined as soon as possible. Your veterinarian will likely want to check a urine sample to look for crystals and infection and perhaps also take an x-ray to rule out a bladder stone.
More...