Deuteronomy 12:10
8 You must not do as we are doing here today, with everyone doing what is right in their eyes, 9 for you have not yet come to the final stop and inheritance the Lord your God is giving you. 10 When you do go across the Jordan River and settle in the land he is granting you as an inheritance and you find relief from all the enemies who surround you, you will live in safety. 11 Then you must come to the place the Lord your God chooses for his name to reside, bringing everything I am commanding you—your burnt offerings, sacrifices, tithes, the personal offerings you have prepared, and all your choice votive offerings that you devote to him. 12 You shall rejoice in the presence of the Lord your God, along with your sons, daughters, male and female servants, and the Levites in your villages (since they have no allotment or inheritance with you).
2 Samuel 7:11
9 I was with you wherever you went, and I defeated all your enemies before you. Now I will make you as famous as the great men of the earth. 10 I will establish a place for my people Israel and settle them there; they will live there and not be disturbed anymore. Violent men will not oppress them again, as they did in the beginning 11 and during the time when I appointed judges to lead my people Israel. Instead, I will give you relief from all your enemies. The Lord declares to you that he himself will build a dynastic house for you. 12 When the time comes for you to die, I will raise up your descendant, one of your own sons, to succeed you, and I will establish his kingdom. 13 He will build a house for my name, and I will make his dynasty permanent.
Notes and References
"... At many points, David is presented favorably - for example, in the accounts of his battle with Goliath (1 Samuel 17) and of his flight from Saul. The account of his early years as king (2 Samuel 5-10) shows how his rule brought great blessing to Israel (see 2 Samuel 5:12). 2 Samuel 7, the climax of the account of David’s rise, suggests the theological and historical significance of what David accomplished: he gave Israel the “rest” (security) in Canaan that Moses had foretold, succeeding where earlier leaders had failed (2 Samuel 7:1, 10-11; compare Deuteronomy 12:10). The narrator notes that David was widely accepted as the only suitable successor to Saul (2 Samuel 5:1-2; compare 1 Samuel 18:16). Even Jonathan and Saul acknowledged this (1 Samuel 23:17; 24:20). Taken together, these features suggest that the account is partly intended as pro-Davidic apologetic. David, after all, could be described as a usurper, for he was not Saul’s son; it is not surprising that the account explains why he was justified in assuming power and defends the steps by which he did so ..."
Arnold, Bill T. Dictionary of the Old Testament: Historical Books (p. 199) InterVarsity Press, 2005