A Commentary, Critical, Practical, and Explanatory on the Old and New Testaments, by Robert Jamieson, A.R. Fausset and David Brown  at sacred-texts.com
psa 102:1A Prayer of the afflicted, &c.--The general terms seem to denote the propriety of regarding the Psalm as suitably expressive of the anxieties of any one of David's descendants, piously concerned for the welfare of the Church. It was probably David's composition, and, though specially suggested by some peculiar trials, descriptive of future times. Overwhelmed--(compare Psa 61:2). Poureth out--pouring out the soul-- (Psa 62:8). Complaint-- (Psa 55:2). The tone of complaint predominates, though in view of God's promises and abiding faithfulness, it is sometimes exchanged for that of confidence and hope. (Psa. 102:1-28)
The terms used occur in Psa 4:1; Psa 17:1, Psa 17:6; Psa 18:6; Psa 31:2, Psa 31:10; Psa 37:20.
psa 102:4(Compare Psa 121:6).
so that I forget--or, "have forgotten," that is, in my distress (Psa 107:18), and hence strength fails.
psa 102:5voice . . . groaning--effect put for cause, my agony emaciates me.
psa 102:6The figures express extreme loneliness.
psa 102:8sworn against me--or literally, "by me," wishing others as miserable as I am (Num 5:21).
psa 102:9ashes--a figure of grief, my bread; weeping or tears, my drink (Psa 80:5).
psa 102:10lifted . . . cast me down--or, "cast me away" as stubble by a whirlwind (Isa 64:6).
psa 102:11shadow . . . declineth--soon to vanish in the darkness of night.
psa 102:12Contrast with man's frailty (compare Psa 90:1-7).
thy remembrance--that by which Thou art remembered, Thy promise.
psa 102:13Hence it is here adduced.
the set time, &c.--the time promised, the indication of which is the interest felt for Zion by the people of God.
psa 102:15God's favor to the Church will affect her persecutors with fear.
psa 102:16When the Lord shall build--or better, "Because the Lord hath built," &c., as a reason for the effect on others; for in thus acting and hearing the humble, He is most glorious.
psa 102:18people . . . created--(compare Psa 22:31), an organized body, as a Church.
psa 102:19For--or, "That," as introducing the statement of God's condescension. A summary of what shall be written.
to loose . . . appointed--or, "deliver" them (Psa 79:11).
psa 102:21To declare, &c.--or, that God's name may be celebrated in the assemblies of His Church, gathered from all nations (Zac 8:20-23), and devoted to His service.
psa 102:23The writer, speaking for the Church, finds encouragement in the midst of all his distresses. God's eternal existence is a pledge of faithfulness to His promises.
in the way--of providence.
weakened--literally, "afflicted," and made fearful of a premature end, a figure of the apprehensions of the Church, lest God might not perform His promise, drawn from those of a person in view of the dangers of early death (compare Psa 89:47). Paul (Heb 1:10) quotes Psa 102:26-28 as addressed to Christ in His divine nature. The scope of the Psalm, as already seen, so far from opposing, favors this view, especially by the sentiments of Psa 102:12-15 (compare Isa 60:1). The association of the Messiah with a day of future glory to the Church was very intimate in the minds of Old Testament writers; and with correct views of His nature it is very consistent that He should be addressed as the Lord and Head of His Church, who would bring about that glorious future on which they ever dwelt with fond delightful anticipations.