"And I was with you wherever you went, etc." (II Samuel 7:9). And elsewhere it says, "Return to the land of your fathers and to your birthplace" (Genesis 31:3), and afterward, "and I will be with you." [Rather, to David, because he sustains Israel, He would say, "And I was with you wherever you went"; but to Jacob, because he sustains his household, He would say, "Return to the land of your fathers" and "I will be with you."] "And I will cut off all your enemies from before you" (II Samuel 7:9). David had ten enemies, five in Israel and five among the nations of the world. Five in Israel: Doeg, and Ahithophel, and Saul, and Shimei son of Gera, and Sheba son of Bichri. Five among the nations of the world: Goliath and his three brothers, and Shovach. One verse says "Shovach" (II Samuel 10:16), and one verse says (I Chronicles 19:16) "Shofach." "Shovach" because he resembled a dovecote (shovach); "Shofach" because his blood was poured out (nishpach) upon the ground. "And I will make you a great name, like the name of the great ones, etc." (II Samuel 7:9). From here the Sages established "the God of David and Builder of Jerusalem," corresponding to "the God of Abraham, Isaac, and Jacob." And on the Sabbath, even though the one who passes before the ark does not mention it, the one who recites the haftarah from the Prophet mentions it: "the God of David, who causes salvation to sprout for His people Israel."
David's Ten Enemies and the God of David Blessing
Midrash Shmuel 26:3
ואהיה עמך בכל אשר הלכת וגו' (שמואל ב' ז' ט'), ולהלן הוא אומר שוב אל ארץ אבותיך ולמולדתך (בראשית ל"א ג'), ואח"כ ואהיה עמך, [אלא דוד ע"י שהוא מפרנס את ישראל היה אומר לו ואהיה עמך בכל אשר הלכת, אבל יעקב ע"י שהוא מפרנס את ביתו היה אומר לו שוב אל ארץ אבותיך ואהיה עמך]. (ואכרית) [ואכריתה] את כל אויביך מפניך (שמואל ב' ז' ט'), עשרה אויבים היו לו לדוד, חמשה בישראל וחמשה באומות העולם, חמשה בישראל, דואג ואחיתופל ושאול ושמעי בן גרא ושבע בן בכרי, חמשה באומות העולם, גלית ושלשת אחיו ושובך, כתוב אחד אומר שובך (שמואל ב' י' י"ו), וכתוב אחד אומר (דה"א י"ט י"ו) שופך, שובך שהיה דומה לשובך, שופך שנשפך דמו על הארץ. ועשיתי לך שם גדול כשם הגדולים וגו' (שמואל ב' ז' ט'), מיכאן קבעו חכמים אלהי דוד ובונה ירושלים, כנגד אלהי אברהם יצחק ויעקב, ובשבת אף על פי שאין העובר לפני התיבה מזכירו, המפטיר בנביא מזכירו, אלהי דוד מצמיח ישועה לעמו ישראל.