Historical commentary by Matthew Henry. The wording and interpretations below belong to the original source.
Confidence in God.
What a sudden change is here for the better! He that was groaning, and weeping, and giving up all for gone ( v. 6, 7 ), here looks and speaks very pleasantly. Having made his requests known to God, and lodged his case with him, he is very confident the issue will be good and his sorrow is turned into joy.
I. He distinguishes himself from the wicked and ungodly, and fortifies himself against their insults ( v. 8 ): Depart from me, all you workers of iniquity. When he was in the depth of his distress, 1. He was afraid that God's wrath against him would give him his portion with the workers of iniquity; but now that this cloud of melancholy had blown over he was assured that his soul would not be gathered with sinners, for they are not his people. He began to suspect himself to be one of them because of the heavy pressures of God's wrath upon him; but now that all his fears were silenced he bade them depart, knowing that his lot was among the chosen. 2. The workers of iniquity had teased him, and taunted him, and asked him, "Where is thy God?" triumphing in his despondency and despair; but now he had wherewith to answer those that reproached him, for God, who was about to return in mercy to him, had now comforted his spirit and would shortly complete his deliverance. 3. Perhaps they had tempted him to do as they did, to quit his religion and betake himself for ease to the pleasures of sin. But now, " depart from me; I will never lend an ear to your counsel; you would have had me to curse God and die, but I will bless him and live." This good use we should make of God's mercies to us, we should thereby have our resolution strengthened never to have any thing more to do with sin and sinners. David was a king, and he takes this occasion to renew his purpose of using his power for the suppression of sin and the reformation of manners, Ps. lxxv. 4 ; ci. 3 . When God has done great things for us, this should put us upon studying what we shall do for him. Our Lord Jesus seems to borrow these words from the mouth of his father David, when, having all judgment committed to him, he shall say, Depart from me, all you workers of iniquity ( Luke xiii. 27 ), and so teaches us to say so now, Ps. cxix. 115 .
II. He assures himself that God was, and would be, propitious to him, notwithstanding the present intimations of wrath which he was under. 1. He is confident of a gracious answer to this prayer which he is now making. While he is yet speaking, he is aware that God hears (as Isa. lxv. 24 , Dan. ix. 20 ), and therefore speaks of it as a thing done, and repeats it with an air of triumph, " The Lord hath heard " ( v. 8 ), and again ( v. 9 ), " The Lord hath heard. " By the workings of God's grace upon his heart he knew his prayer was graciously accepted, and therefore did not doubt but it would in due time be effectually answered. His tears had a voice, a loud voice, in the ears of the God of mercy: The Lord has heard the voice of my weeping. Silent tears are not speechless ones. His prayers were cries to God: " The Lord has heard the voice of my supplication, has put his Fiat—Let it be done, to my petitions, and so it will appear shortly." 2. Thence he infers the like favourable audience of all his other prayers: "He has heard the voice of my supplication, and therefore he will receive my prayer; for he gives, and does not upbraid with former grants."