James Madison was President of the United States when war was declared.
From the Montpelier Organization:
When James Madison addressed his war message to Congress on June 1, 1812, he listed “a series of acts hostile to the United States as an independent and neutral nation.”
Madison concluded by reminding Congress that under the Constitution, it was their decision to declare war. After a 79-49 vote in favor of war in the House of Representatives and a 19-13 vote in the Senate, war was declared against Great Britain on June 18.
See Mr. Madison's War.