It is strange the reason of the prohibition to swear an oath "by Jerusalem", if the "king" who is intended is David. I can understand the reason of the prohibition to do an oath "by heaven": it is not our but of God.“Again, you have heard that it was said to the people long ago, ‘Do not break your oath, but fulfill to the Lord the vows you have made.’ 34 But I tell you, do not swear an oath at all: either by heaven, for it is God’s throne; 35 or by the earth, for it is his footstool; or by Jerusalem, for it is the city of the Great King
Idem for the earth: it is of God, so we can't promise it in an oath.
But if Jerusalem is property of David, why can't the man do an oath on it? What escapes me is the reason why David would be not "our" (of the Christians) like the earth or the heaven.
Unless the "great king" is Hadrian, and so the Christians can't do an oath on a Pagan city: surely it is not (more) their city.