21 When David's time to die approached, he charged his son Solomon, saying, 2 "I'm about to go the way of all the earth, but you - be strong; show what you're made of! 3 Do what God tells you. Walk in the paths he shows you: Follow the life-map absolutely, keep an eye out for the signposts, his course for life set out in the revelation to Moses; then you'll get on well in whatever you do and wherever you go. 4 Then God will confirm what he promised me when he said, 'If your sons watch their step, staying true to me heart and soul, you'll always have a successor on Israel's throne.' 5 "And don't forget what Joab son of Zeruiah did to the two commanders of Israel's army, to Abner son of Ner and to Amasa son of Jether. He murdered them in cold blood, acting in peacetime as if he were at war, and has been stained with that blood ever since. 6 Do what you think best with him, but by no means let him get off scot-free - make him pay. 7 "But be generous to the sons of Barzillai the Gileadite - extend every hospitality to them; that's the way they treated me when I was running for my life from Absalom your brother. 8 "You also will have to deal with Shimei son of Gera the Benjaminite from Bahurim, the one who cursed me so viciously when I was on my way to Mahanaim. Later, when he welcomed me back at the Jordan, I promised him under God, 'I won't put you to death.' 9 But neither should you treat him as if nothing ever happened. You're wise, you know how to handle these things. You'll know what to do to make him pay before he dies."
10 Then David joined his ancestors. He was buried in the City of David. 11 David ruled Israel for forty years - seven years in Hebron and another thirty-three in Jerusalem.
Matthew Henry's Commentary on 1 Kings 2:1-11
Commentary on 1 Kings 2:1-4
(Read 1 Kings 2:1-4)
David's charge to Solomon is, to keep the charge of the Lord. The authority of a dying father is much, but nothing to that of a living God. God promised David that the Messiah should come from his descendants, and that promise was absolute; but the promise, that there should not fail of them a man on the throne of Israel, was conditional; if he walks before God in sincerity, with zeal and resolution: in order hereunto, he must take heed to his way.
Commentary on 1 Kings 2:5-11
(Read 1 Kings 2:5-11)
These dying counsels concerning Joab and Shimei, did not come from personal anger, but for the security of Solomon's throne, which was the murders he had committed, but would readily repeat them to carry any purpose; though long reprieved, he shall be reckoned with at last. Time does not wear out the guilt of any sin, particularly of murder. Concerning Shimei, Hold him not guiltless; do not think him any true friend to thee, or thy government, or fit to be trusted; he has no less malice now than he had then. David's dying sentiments are recorded, as delivered under the influence of the Holy Ghost, 2 Samuel 23:1-7. The Lord discovered to him the offices and the salvation of that glorious personage, the Messiah, whose coming he then foretold, and from whom he derived all his comforts and expectations. That passage gives a decided proof that David died under the influence of the Holy Ghost, in the exercise of faith and hope.