Hello and welcome to JustAnswer,
Great question. Difficult to answer. If he took an Xray and did an exam then I think the dentist is likely to be correct. It IS possible to have a maxillary sinus infection with the only symptoms being pain in the molar(s) on one side or the other.
I am surprised that the dentist did not put you on antibiotics but perhaps that would have been out of his area and frowned upon.
I think there are two options, the first being the one I would do if i were you. I would call your doctor or go to an urgent care and say that a dentist has diagnosed you with a maxillary sinusitis when you thought you had a cavity and that you need to be treated for this.
Within a day or two of starting the proper antibiotics you should note a decrease in pain and it should then go away.
The second option would be a second dental exam, but, with an Xray and exam done, I feel very confident that the first dentist is correct. This problem, believe it or not, is quite common.