they don't swear an oath 'TO' anyone.
they swear an oath to defend the Constitution. They swear to obey orders given by President, assuming they are lawful.
Here is oath enlisted take:
"
I, (NAME), do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; and that I will obey the orders of the President of the United States and the orders of the officers appointed over me, according to regulations and the Uniform Code of Military Justice. So help me God."
they don't swear an oath 'TO' anyone. they swear an oath to defend the Constitution. They swear to obey orders given by President, assuming they are lawful.
Here is oath enlisted take: " I, (NAME), do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; and that I will obey the orders of the President of the United States and the orders of the officers appointed over me, according to regulations and the Uniform Code of Military Justice. So help me God."