And now, O LORD God, confirm forever the word that you have spoken concerning your servant and concerning his house, and do as you have spoken.
We have here the solemn address David made to God, in answer to the gracious message God had sent him. We are not told what he said to Nathan; no doubt he received him very kindly and respectfully as God's messenger. But his answer to God he took himself, and did not send by Nathan.
Commenting on 2 Samuel 7:18-29
And now, O Lord God,.... From confessions of unworthiness, and of the goodness of God, and a recital of favours conferred on him and the people of Israel, David proceeds to petitions: the word that thou hast spoken concerning thy servant, and concerning his house, establish it for ever: he prays for the sure performance of the promise of God respecting himself and his family...
And do as thou hast said - David well knew that all the promises made to himself and family were conditional; and therefore he prays that they may be fulfilled. His posterity did not walk with God, and therefore they were driven from the throne.