1 Kings 9:4

4 If you will serve me in honesty and integrity, as your father David did, and if you obey my laws and do everything I have commanded you,

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 him again, as he had in Gibeon.
3 The Lord said to him, "I have heard your prayer. I consecrate this Temple which you have built as the place where I shall be worshiped forever. I will watch over it and protect it for all time.
4 If you will serve me in honesty and integrity, as your father David did, and if you obey my laws and do everything I have commanded you,
5 I will keep the promise I made to your father David when I told him that Israel would always be ruled by his descendants.
6 But if you or your descendants stop following me, disobey the laws and commands I have given you, and worship other gods,
Scripture taken from the Good News Translation - Second Edition, Copyright 1992 by American Bible Society. Used by Permission.