Thanks for posting,
First of all doctors would not find out you have masturbated unless you tell them. Secondly it will be more useful information if you told a doctor (who is sworn by oath to keep your secret even away from your parents) that you masturbation
as it will facilitate determining the cause of your frequent urination
. Normally a sample of your urine will be collected to test for bacteria infection or urethritis
or UTI which might have been contracted from any unhygienic condition around your penis including your hands. E. coli is very likely given your presenting symptoms.
could also make you have frequent urination and sensation that your penis is burning since presently you probably have the feeling of guilt since this is your first time.
But be careful not to become an 'addictive masturbator' that will play negatively in your future relations.
Hope this helps you