Is this Solomon quoting the words of David? It would seem so. The only reason to question that might be in verse 1 where Solomon talks about “a father” instead of “my father”. But he seems to be making this a personal statement. So consider this the words of David passed on by his son.
In our “heart” (3820) we must “retain" (hold fast NASB) (8551) to the “commandments” (4687). This implies that obedience begins in our core being and then moves out to our behavior. We have so many excuses for our failures. I believe it was a comedian named Flip Wilson who had a routine where he made a big deal of “the devil made me do it.” We have our own versions of how this works. Or am I the only one? We live in a culture that makes excuses for us and we cling to them.
We are to “keep” (8104) the “commandments” (4687). I think we can assume that this will not happen automatically in most cases. We need to consciously be aware of right and wrong. Although Solomon is talking about the direction given by his father, assume that the words of David were based in the law of God. And don’t let distractions about the Law get you off track. This is not a command to keep the kosher law or the ceremonial law, this deals with the moral law. This involves those standards that are universal, not just those aimed at the Jews.
And we have the promise of life. This was very real in those days. Father had the literal power of life and death over their children. Obviously it also applies to the figurative idea of the quality of life and the eternal idea of our resurrection expectations, but it starts in the reality of today. So this is a promise that begins today and extends through eternity. It is echoed several times in the Bible but the most complete is this:
(Deuteronomy 5:16 KJV) Honour thy father and thy mother, as the LORD thy God hath commanded thee; that thy days may be prolonged, and that it may go well with thee, in the land which the LORD thy God giveth thee.So make up your mind, or heart, that you are going to walk the road of obedience. As you go out the door today be aware that God has high expectations of you. Be a faithful child of God.