1 Kings 9:4

4 As for you, if you will walk before me, as David your father walked, with integrity of heart and uprightness, doing according to all that I have commanded you, and keeping 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 the Lord appeared to Solomon a second time, as he had appeared to him at Gibeon.
3 The Lord said to him, "I have heard your prayer and your plea, which you made before me; I have consecrated this house that you have built, and put my name there forever; my eyes and my heart will be there for all time.
4 As for you, if you will walk before me, as David your father walked, with integrity of heart and uprightness, doing according to all that I have commanded you, and keeping my statutes and my ordinances,
5 then I will establish your royal throne over Israel forever, as I promised your father David, saying, "There shall not fail you a successor on the throne of Israel.'
6 "If you turn aside from following me, you or your children, and do not keep my commandments and my statutes that I have set before you, but go and serve other gods and worship them,
New Revised Standard Version Bible, copyright 1989, Division of Christian Education of the National Council of the Churches of Christ in the United States of America. Used by permission. All rights reserved.