1 Kings 15:3-4

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.