1 Kings 15:3-5

15:3 He followed all the sinful practices of his father before him. He was not wholeheartedly devoted to the Lord his God, as his ancestor David had been. 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.