The Lord did this because David did what the Lord considered right: David never failed to do anything the Lord commanded him to do his entire life (except in the matter concerning Uriah the Hittite).
⌞You’ll succeed⌟ because the Lord will keep the promise he made to me: ‘If your descendants are faithful to me with all their hearts and lives, you will never fail to have an heir on the throne of Israel.’
if they change their attitude toward you in the land of their enemies where they are captives, if they pray to you toward the land that you gave their ancestors, and the city you have chosen, and the temple I have built for your name,
The king stood beside the pillar and made a promise to the Lord that he would follow the Lord and obey his commands, instructions, and laws with all his heart and soul. He confirmed the terms of the promise written in this book. And all the people joined in the promise.
They joined their relatives, the nobles, in binding themselves with a curse and an oath to follow God’s teachings given by Moses, God’s servant. They also bound themselves to follow all the commandments, rules, and regulations of the Lord our Lord.
Do you think you’re a better king than others because you use more cedar? Your father ate and drank and did what is fair and right. Everything went well for him.
But if you look for the Lord your God when you are among those nations, you will find him whenever you search for him with all your heart and with all your soul.