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.
I tore the kingdom away from the Davidic dynasty and gave it to you. But you are not like my servant David, who kept my commandments and followed me wholeheartedly by doing only what I approve.
Solomon demonstrated his loyalty to the Lord by following the practices of his father David, except that he offered sacrifices and burned incense on the high places.
After removing him, God raised up David their king. He testified about him: ‘I have found David the son of Jesse to be a man after my heart, who will accomplish everything I want him to do.’
Then he will not exalt himself above his fellow citizens or turn from the commandments to the right or left, and he and his descendants will enjoy many years ruling over his kingdom in Israel.
Please forgive the sin of your servant, for the Lord will certainly establish the house of my lord, because my lord fights the battles of the Lord. May no evil be found in you all your days!