I Kings 2.1-12
When the time of David’s death drew near, he charged Solomon his son, saying:
“I am about to go the way of all the earth; therefore, be strong and show yourself a man. You must keep the charge of God your Lord, walking in his ways, and keeping His statutes, commandments, judgements and testimonies, as it is written in the Torah of Moses, so that you may prosper in all you do, and wherever you turn. Then God will establish His word He spoke concerning me, saying: If your children watch their step, to walk before Me in truth with all their heart and soul, there will always be a man [from your house] on the throne of Israel.
“You also know what Joab the son of Tzeruya did to me, and what he did to the two captains of the Israelite army, Abner the son of Ner and Amasa the son of Yether, whom he murdered, thus shedding of the blood of war in a time of peace, putting the blood of war on the girdle about his loins and in the shoes on his feet. Therefore act wisely, and do not let his grey head down to the grave in peace. But be kind to the sons of Barzilai the Gileadite, and let them be among those who eat at your table; for they assisted me when I fled from Absalom, your brother. Behold, you have Shimi the son of Gera, the Benjamite from Bachurim, who cursed me with a grievous curse on the day I went to Machanaim. When he came down to meet me at the Jordan, I swore to him by God, saying ‘I will not kill you with the sword.’ Therefore do not hold him innocent, for you are a wise man; you will know what to do to him, and you must not bring his grey head down to the grave with blood.”
Then David slept with his fathers, and was buried in the city of David. David reigned over Israel for forty years: he reigned seven years in Hebron and thirty-three years in Jerusalem. Then Solomon sat on the throne of David his father; and his kingdom was firmly established.