1 Kings 15:5

5 in that David did that which [is] right in the eyes of Jehovah, and turned not aside from all that He commanded him all days of his life -- only in the matter of Uriah the Hittite;

1 Kings 15:5 Meaning and Commentary

1 Kings 15:5

Because David did that which was right in the eyes of the Lord,
&c.] With respect to worship: and turned not aside from anything that he commanded him all the days of his life; especially in matters of religion, nor even in his moral walk and conversation, deliberately, studiously, and with design:

save only in the matter of Uriah the Hittite;
the killing of him, and other sins which led on to it, and were in connection with it; Abarbinel thinks, because the affair of Bathsheba is not mentioned, that was not reckoned to David as a sin; but no doubt it was, and is included here.

1 Kings 15:5 In-Context

3 and he walketh in all the sins of his father, that he did before him, and his heart hath not been perfect with Jehovah his God, as the heart of David his father;
4 but for David's sake hath Jehovah his God given to him a lamp in Jerusalem, to raise up his son after him, and to establish Jerusalem,
5 in that David did that which [is] right in the eyes of Jehovah, and turned not aside from all that He commanded him all days of his life -- only in the matter of Uriah the Hittite;
6 and war hath been between Rehoboam and Jeroboam all the days of his life.
7 And the rest of the matters of Abijam, and all that he did, are they not written on the book of the Chronicles of the kings of Judah? And war hath been between Abijam and Jeroboam;
Young's Literal Translation is in the public domain.