Franklin Pierce served in the Mexican American War and was given a commission by President James Polk.