John Gill's Bible Commentary Ver. 4. And if thou wilt walk before me, as David thy father walked, in integrity of heart, and in uprightness. etc.] Who, though guilty of many sins and failings in life, yet was sincere and upright in the worship of God, never apostatized from it, or fell into idolatry, which is what is chiefly respected: to do according to all that I have commanded thee, and wilt keep my statutes and my judgments ; observe all the laws of God, moral, ceremonial, and judicial.
Matthew Henry Commentary
Verses 1-9 - God warned Solomon, now he had newly built and dedicated the temple that he and his people might not be high-minded, but fear. After all the services we can perform, we stand upon the same terms with the Lor as before. Nothing can purchase for us liberty to sin, nor would the true believer desire such a licence. He would rather be chastened of the Lord, than be allowed to go on with ease and prosperity in sin.
Original Hebrew ואתה859 אם518 תלך1980 לפני6440 כאשׁר834 הלך1980 דוד1732 אביך1 בתם8537 לבב3824 ובישׁר3476 לעשׂות6213 ככל3605 אשׁר834 צויתיך6680 חקי2706 ומשׁפטי4941 תשׁמר׃8104