1 Kings 15:5 NKJV

5 because David did what was right in the eyes of the Lord, and had not turned aside from anything that He commanded him all the days of his life, except in the matter of Uriah the Hittite.