Ellicott's Commentary On The Whole Bible
1 Chronicles 17:15
According to all these words, and according to all this vision. — The matter of this prophecy (1 Chronicles 17:3) undoubtedly rests upon authentic tradition. Neither the compiler of Samuel, however, nor the chronicler professes to give an exact report of the words of Nathan, as if they had been taken down on the spot, as they were uttered, by some shorthand reporter. The modern demand for literal accuracy was unknown to Oriental antiquity. Where the two narratives vary, sometimes Samuel, sometimes the Chronicle, contains the more original form of the tradition. 1 Chronicles 17:15 (2 Samuel 7:17), in fact, seems to imply that the essence rather than the actual words of the oracle is given.
2. David’s prayer (1 Chronicles 17:16). The remarks on 1 Chronicles 17:15 apply generally to this section also. The prayer undoubtedly breathes the genuine Davidic spirit, even if it be merely an ideal soliloquy. But why may not David himself have recorded the substance of it as a memorial?