James Buchanan, the 15th President of the United States, is the only president to have military experience without having been an officer. He was a private in the Pennsylvania militia in 1814.