1 Kings 9:4

4 As for you, if you will walk before me, as David your father walked, in integrity of heart, and in uprightness, to do according to all that I have commanded you, and will keep my statutes and my ordinances;

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 the LORD appeared to Shlomo the second time, as he had appeared to him at Giv`on.
3 The LORD said to him, I have heard your prayer and your supplication, that you have made before me: I have made this house holy, which you have built, to put my name there forever; and my eyes and my heart shall be there perpetually.
4 As for you, if you will walk before me, as David your father walked, in integrity of heart, and in uprightness, to do according to all that I have commanded you, and will keep my statutes and my ordinances;
5 then I will establish the throne of your kingdom over Yisra'el forever, according as I promised to David your father, saying, There shall not fail you a man on the throne of Yisra'el.
6 But if you shall turn away from following me, you or your children, and not keep my mitzvot and my statutes which I have set before you, but shall go and serve other gods, and worship them;
The Hebrew Names Version is in the public domain.