1 Kings 9:4

4 As for you, if you walk before Me as your father David walked, with integrity of heart and uprightness, doing everything I have commanded you, and if you keep My statutes and 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 just as He had appeared to him at Gibeon.
3 The Lord said to him: I have heard your prayer and petition you have made before Me. I have consecrated this temple you have built, to put My name there forever; My eyes and My heart will be there at all times.
4 As for you, if you walk before Me as your father David walked, with integrity of heart and uprightness, doing everything I have commanded you, and if you keep My statutes and ordinances,
5 I will establish your royal throne over Israel forever, as I promised your father David: You will never fail to have a man on the throne of Israel.
6 If you or your sons turn away from following Me and do not keep My commands-My statutes that I have set before you-and if you go and serve other gods and worship them,
Holman Christian Standard Bible ® Copyright © 2003, 2002, 2000, 1999 by Holman Bible Publishers.  Used by permission.  All rights reserved.