2 I go the way of all the earth: be of good courage therefore, and be a man; 3 and keep the charge of Jehovah thy God, to walk in his ways, to keep his statutes, and his commandments, and his ordinances, and his testimonies, as it is written in the law of Moses, that thou mayest prosper in all that thou doest and whithersoever thou turnest thyself; 4 that Jehovah may confirm his word which he spoke concerning me, saying, If thy sons take heed to their way, to walk before me in truth with all their heart and with all their soul, there shall not fail thee, said he, a man upon the throne of Israel.
Matthew Henry's Commentary on 1 Kings 2:2-4
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.