The verse-
Do not be discouraged, for Jesus is your friend,
And if you seek for knowledge, he'll not refuse to lend,
was used in a hymn called the Sunday School Army by John A Grenade who was perhaps the original 'tent revival' preacher. Around 1785 to 1805. The Sunday school army movement(medals for perfect attendance in SS.)was popular at the time but didn't originate with Grenade, who was known as the Wild Man from Goose Creek. I think he may have adapted the old hymn and it's melody from somewhere else, I'm not sure. We need to ask Jean Ritchie about this, if anybody, she would know.