Albert Sidney Johnston (February 2, 1803 – April 6, 1862) was a career U.S. Army officer and a Confederate general during the American Civil War .