remember David = remember for David: i.e. remember to fulfill the promises made to him.
David. Hezekiah remembers David, and puts Jehovah in remembrance of him.
all his afflictions = all his being afflicted: all his anxious cares as to his work. The Temple was Heze-kiah's care, as it had been David's. Not "post-exilic". We see these anxieties from the beginning of his reign (2Sa_7:1, 1Ch_13:3; 1Ch_21:18-30; 1Ch_22:1. The subjects of these last three Psalms are merged in blessing.