1 Kings 15:4-5

15:4 Nevertheless for David’s sake the Lord his God maintained his dynasty in Jerusalem by giving him a son to succeed him and by protecting Jerusalem. 15:5 He did this because David had done what he approved and had not disregarded any of his commandments his entire lifetime, except for the incident involving Uriah the Hittite.