Aside from the high blood numbers, what were the symptoms you were experiencing?
To be honest, if your dentist has given you Cephalexin because you have an infection it could be the infection is what is pushing your blood glucose numbers up, as much as the medication. That your bloods remain high, could bear that out. If he gave you antibiotics at all, he must have considered them to be very necessary.
Obviously that can only be speculation, or educated guess, on my part.
One thing I will say is, having stopped the medication, your infection may get worse, and faster than it was before. Please do keep an eye on that and if your condition worsens, please seek medical advice, by calling 111, or if you feel very ill indeed, with high blood sugars, then A&E could be wise.
Be careful