5 For David had done what was right in the eyes of the LORD and had not failed to keep any of the LORD’s commands all the days of his life—except in the case of Uriah the Hittite.

Read 1 Kings 15:5 Using Other Translations

Because David did that which was right in the eyes of the LORD, and turned not aside from any thing that he commanded him all the days of his life, save only in the matter of Uriah the Hittite.
because David did what was right in the eyes of the LORD and did not turn aside from anything that he commanded him all the days of his life, except in the matter of Uriah the Hittite.
For David had done what was pleasing in the LORD ’s sight and had obeyed the LORD ’s commands throughout his life, except in the affair concerning Uriah the Hittite.