1 Kings 15: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.