Commentary on the Bible, by Adam Clarke, [1831], at sacred-texts.com
David consults Nathan about building a temple for God, Ch1 17:1, Ch1 17:2. God sends him an answer by Nathan, informing him that Solomon shall build the house, Ch1 17:3-14. David receives the Divine purpose with humility and joy, and gives God praise, Ch1 17:15-27.
Now it came to pass - See every thing recorded in this chapter amply detailed in the notes on Sa2 7:1 (note), etc.
But have gone from tent to tent - "I have transferred my tabernacle from Gilgal to Nob, from Nob to Shiloh, and from Shiloh to Gibeon." - Targum and Jarchi.
Neither shall the children of wickedness - They shall no more be brought into servitude as they were in the time they sojourned in Egypt. This is what is here referred to.
I will establish his throne for ever - David was a type of Christ; and concerning him the prophecy is literally true. See Isa 9:7, where there is evidently the same reference.
I will not take my mercy away from him - I will not cut off his family from the throne, as I did that of his predecessor Saul.
And what is mine house, that thou hast brought me hitherto? - I am not of any regal family, and have no natural right to the throne.
Hath found in his heart to pray - The Targum expresses a full sense: "Therefore thy servant hath found an opening of mouth, that he might pray before Thee.
For thou blessest, O Lord - "Thou beginnest to bless the house of thy servant, therefore it shall be blessed for ever." - T.
The reader is requested to refer to 2 Samuel 7 (note), and the notes there for many particulars that belong to the parallel places here, and which it should answer no good purpose to repeat in this place.