1 Kings 2:4
That the LORD may continue his word which he spake concerning me, saying, If thy children 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 on the throne of Israel.
The word to be continued was the word spoken concerning David, delivered as part of his charge to Solomon, that Israel's throne would remain in David's family only if his children took heed to their way and walked before God in truth with all their heart and with all their soul. To walk in that way is to walk in obedience to God's ways and law — His commandments, statutes, judgments, and testimonies as given through Moses — in righteousness and truth. If that condition was met, there would not fail to be a man of David's line on the throne of Israel, and Solomon and Israel would prosper and fulfill the responsibility entrusted to them. Solomon at first honored that charge, but later failed to remain faithful.
In its setting, David was settling the affairs of his kingdom and warning Solomon about Shimei as a violent and dangerous man who could stir rebellion or threaten Solomon's life. In the same charge, David urged Solomon to build the temple and obey God, while God promised Solomon wisdom and understanding for his work, with the promise made conditional on walking in righteousness and truth.
The solemn charge still applies to people in positions of trust today, for God's people in this time of probation are tested and tried as in Solomon's day. It calls physicians in particular to walk before God in truth and righteousness.