the military oath is to the USA Constitution....not to the POTUS
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.
....against all enemies, foreign &domestic.....hmmmm
That is the oath of enlistment. The only time I took that one was when enlisting in the Air Force Reserve, inactive status. They make all scholarship, and all "professional program", (last two years of AFROTC) cadets do that. After that I took the Oath of Office as a commssioned officer, and was released from the enlited assignment and oath.
The officers' oath, does not contain the "obey the orders" or "UCMJ" language. That oath, the same one taken by the Vice President and other federal officers, is:
Officer Oath: I, A.B., 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; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office on which I am about to enter. So help me God.
The enlisted oath only added the "support and defend the Constitution" language in 1962. The officers' oath is unchanged since 1868.
A nice history of both oaths can be found at: Air & Space Power Journal - Winter 2002 (The Professional Journal of the United States Air Force). This article was by then Lt Col Kenneth Keskel, USAF(USAFA; MS, University of Florida)