2 Samuel 7:12
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. 14 I will become his father and he will become my son. When he sins, I will correct him with the rod of men and with wounds inflicted by human beings.
Amos 9:11
9 “For look, I am giving a command, and I will shake the family of Israel together with all the nations. It will resemble a sieve being shaken, when not even a pebble falls to the ground. 10 All the sinners among my people will die by the sword—the ones who say, ‘Disaster will not come near, it will not confront us.’ 11 “In that day I will rebuild the collapsing hut of David. I will seal its gaps, repair its ruins, and restore it to what it was like in days gone by. 12 As a result they will conquer those left in Edom and all the nations subject to my rule.” The Lord, who is about to do this, is speaking. 13 “Be sure of this, the time is coming,” says the Lord, “when the plowman will catch up to the reaper, and the one who stomps the grapes will overtake the planter. Juice will run down the slopes; it will flow down all the hillsides.
Notes and References
"... The promise of an ideal son of David to build and lead the nation conflicts with the severe shortcomings of David introduced at 2 Samuel 11 and sustained through 2 Samuel 20. His sin with Bathsheba and his inability to control his family call into question the program detailed by God in 2 Samuel 7. The rejection of King Saul in 1 Samuel highlights the need for a righteous and faithful king and raises the question of whether David himself might be rejected like Saul, making null and void the covenant. The narrative thus suspends a contrastive tension between the Davidic ideal and the reality of David’s failures, creating a “deliberately emphasized antinomy” that drives the reader past the pages of 1-2 Samuel for the answers. Some Old Testament prophetic texts also sustain the tension between the ideal figure of David’s son with the realization that few if any of his descendants lived up to that ideal (e.g., Amos 9:11-12; Isaiah 11:1-2; Jeremiah 23:5). The books of Samuel do not resolve the tension fully, but rather set the course for future messianism to evolve by presenting the ideas in germinal form ..."
Arnold, Bill T. Dictionary of the Old Testament: Historical Books (p. 874) InterVarsity Press, 2005