After finishing his education in the schools of New York city, young Sweeny was apprenticed to the printing business in the well known firm of Gould, Banks & Company (now, 1899, Banks & Brother), at that time the leading law book publishers of the United States, “where his many good qualities made him a general favorite.”

He early evinced a taste for military training, and in 1837, while a mere youth, attached himself to a military and literary association of young men known as the “Paul Jones Parading Club,” commanded by Capt. Joseph Hinken. Afterwards they placed themselves under the command of Capt. W. W. Tompkins, and adopted the name of “Tompkins’ Cadets.” They then consolidated with the “Scott Cadets,” commanded by Capt. Charles Baxter, and in 1842 or 1843, they were again strengthened by a portion of the seceders from the “Tompkins’ Blues,” whereupon, for the purpose of identification, they adopted the name “Independent Tompkins’ Blues.”

At the breaking out of the Mexican War, in 1846, Sweeny was one of the first to volunteer, and he was elected second lieutenant in Company A of the First New York Volunteers, commanded by Col. Ward B. Burnett. On Christmas day, 1846, Messrs. Gould, Banks & Company, uniting with a large number of individuals in their employ, took the occasion—which was also his birthday—to present Lieutenant Sweeny “a handsome pair of revolving pistols as a token of esteem and regard.”

On Jan. 8, 1847, Sweeny’s regiment, to the number of about 800 men, sailed from New York for the seat of war. At Lobos Island, near Vera Cruz, where the troops landed, Lieutenant Sweeny was placed in command of a detachment to prepare the ground for encampment. This was his first command, and was “executed with dispatch and to the full satisfaction of his superior officer.” Speaking of his subsequent movements an eye witness says: “After the bombardment of Vera Cruz, his regiment with the others, was marched into the interior. It was at Cerro Gordo, April 18, 1847, that Lieutenant Sweeny first practically smelt powder. Company A and one other were detached to support Capt. Francis Taylor’s battery in taking the first height. They cut a road through the chaparral for the artillery, to the left of the enemy’s position, in order to turn it. After reaching the base of the hill, and winding around it, they halted for orders. They were here exposed to a raking fire of grape and canister from the Mexican batteries.”

At Contreras, Aug. 19, 1847, where the New York regiment stood the whole night in a gully up to their knees in mud, the men were greatly encouraged by the bearing of Lieutenant Sweeny.

At Churubusco, Aug. 20, 1847, while leading his men into action, Sweeny was struck in the groin by a spent ball. It passed through three pieces of clothing and produced a painful, though not dangerous, wound. Although advised to retire, he refused so long as he was able to stand. In a few minutes he was again wounded, receiving a musket ball in the right arm, but nevertheless he continued to lead and animate his men until he sank from exhaustion and loss of blood and had to be carried to the rear.

The wound in his arm proved to be so serious that amputation was found to be necessary in order to save his life. General Shields, who was present at the operation, was affected even to tears at the fortitude displayed by Sweeny, who, notwithstanding the fact that no anæsthetics were used, showed not the slightest signs of flinching under the terrible ordeal.

On his return to New York city, in 1848, Lieutenant Sweeny was received with much honor; he was brevetted captain by the governor of the state, and was presented a silver medal by the city government. He was also given a “grand reception ball” at Castle Garden, which was described as the “largest and most brilliant ball of the season.” Among the invited guests were ex-President Martin Van Buren, Major-Gen. John A. Quitman, U. S. A., Hon. Simon Cameron of Pennsylvania, Hon. William B. Maclay, M. C., representatives of the city and state governments and other people of note.

On recommendation of General Scott, Sweeny was appointed by the president a second lieutenant in the Second United States Infantry, March 3, 1848, and from March to July, 1848, he was stationed at Fort Columbus, Governor’s Island, New York harbor. During August and September, 1848, Lieutenant Sweeny was at Jefferson Barracks, Missouri, and in October, 1848, he was stationed at Fort Hamilton, New York harbor, on recruiting service.

Nov. 8, 1848, his regiment, under command of Brevet Maj.-Gen. Bennett Riley, who had been appointed military governor of California, sailed from New York for California via Cape Horn. At Rio Janerio, where they stopped several days, they were entertained at a ball aboard the United States steamship Brandywine. They reached Monterey, Cal., April 6, 1849, and soon established regimental headquarters at San Diego.