The earliest printed copy of this tune is found in Thomas Durfey's Wit and Mirth: or, Pills to Purge Melancholy (1720) as "The London Prentice". It was popular in England, Ireland and Scotland. Variants and alternate titles include: "The London Apprentice" and "The Jolly Boatsman" (a variant in Kentucky).
The tune is the Irish air "The Winding Banks of Erne".
It is number 368 in the Roud Folksong Index.
It is widely known and often recorded by many performers. I think I first learned it from either Richard Dyer-Bennet or Burl Ives.