It sounds very much like your 10 yr old has an urinary tract infection
(UTI). What points to it is the pain in the penis and the sudden wetting at night (after years of being dry). It is possible that the bug causing the ear infection
is the same one affecting the urine as these can spread in the body via the blood stream. The best method to confirm this is to get a urine sample examined at your nearest lab for a routine microscopy examination and a urine culture. IF there is active infection, he would need appropriate antibiotics that would be chosen based on the urine culture report. Please revert back with the urine tests.