1 Kings 9:4

4 `And thou -- if thou dost walk before Me as David thy father walked, in simplicity of heart, and in uprightness, to do according to all that I have commanded thee -- My statutes and My judgments thou dost keep --

1 Kings 9:4 Meaning and Commentary

1 Kings 9:4

And if thou wilt walk before me, as David thy father walked, in
integrity of heart, and in uprightness.
&c.] 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.

1 Kings 9:4 In-Context

2 that Jehovah appeareth unto Solomon a second time, as He appeared unto him in Gibeon,
3 and Jehovah saith unto him, `I have heard thy prayer and thy supplication with which thou hast made supplication before Me; I have hallowed this house that thou hast built to put My name there -- unto the age, and Mine eyes and My heart have been there all the days.
4 `And thou -- if thou dost walk before Me as David thy father walked, in simplicity of heart, and in uprightness, to do according to all that I have commanded thee -- My statutes and My judgments thou dost keep --
5 then I have established the throne of thy kingdom over Israel -- to the age, as I spake unto David thy father, saying, There is not cut off to thee a man from [being] on the throne of Israel.
6 `If ye at all turn back -- you and your sons -- from after Me, and keep not My commands -- My statutes, that I have set before you, and ye have gone and served other gods, and bowed yourselves to them,
Young's Literal Translation is in the public domain.