Where did the John Jacob Jingleheimer Schmidt song come from?

You know, the song that kids sing, sooner or later to the great annoyance of their elders, that includes the lines,

whenever I go out, the people always shout, "There goes John Jacob Jingleheimer Schmidt DA-DAH-DAH-DAH-DAH-DAH-DAH-DAH!!

I wonder because I imagine it’s a very old part of American folk culture. Also, it seems that Germans were pretty prominent in early American history, what with all the Pennsylvania Dutch immigrants, as well as Von Steuben’s contributions to the revolution.

So where does this song come from? And if you live in another Anglophone country, do kids sing it there, too?

According to an English (American actually) teacher I once had it’s about making fun of immigrants anglicising their names.