This is a psalm of thanksgiving for the great deliverances which God had wrought for David, penned upon occasion of the dedicating of his house of cedar, and sung in that pious solemnity, though there is not any thing in it that has particular reference to that occasion. Some collect from divers passages in the psalm itself that it was penned upon his recovery from a dangerous fit of sickness, which might happen to be about the time of the dedication of his house. I. He here praises God for the deliverances he had wrought for him, Ps. 30:1-3. II. He calls upon others to praise him too, and encourages them to trust in him, Ps. 30:4, 5. III. He blames himself for his former security, Ps. 30:6, 7. IV. He recollects the prayers and complaints he had made in his distress, Ps. 30:8-10. With them he stirs up himself to be very thankful to God for the present comfortable change, Ps. 30:11, 12. In singing this psalm we ought to remember with thankfulness any like deliverances wrought for us, for which we must stir up our selves to praise him and by which we must be engaged to depend upon him.