Hear me when I call, O God of my righteousness: thou hast enlarged me when I was in distress; have mercy upon me, and hear my prayer. (Psalm 4:1)
In these words there is shown the faith of David, who, although brought to the uttermost distress, and indeed almost consumed by a long series of calamities, did not sink under his sorrow; nor was he so broken in heart as to be prevented from betaking himself to God his deliverer.
By his praying, he testified, that when utterly deprived of all earthly succor, there yet remained for him hope in God. Moreover, he calls him the God of his righteousness, which is the same thing as if he had called him the vindicator of his right; and he appeals to God, because all men everywhere condemned him, and his innocence was borne down by the slanderous reports of his enemies and the perverse judgments of the common people.
And this cruel and unjust treatment which David met with, ought to be carefully marked. For while nothing is more painful to us than to be falsely condemned, and to endure, at one and the same time, wrongful violence and slander; yet to be ill spoken of for doing well, is an affliction which daily befalls the saints. And it becomes them to be so exercised under it as to turn away from all the enticements of the world, and to depend wholly upon God alone.
Righteousness, therefore, is here to be understood of a good cause, of which David makes God the witness, while he complains of the malicious and wrongful conduct of men towards him; and, by his example, he teaches us, that if at any time our uprightness is not seen and acknowledged by the world, we ought not on that account to despond, inasmuch as we have one in heaven to vindicate our cause. Even the heathen have said there is no better stage for virtue than a man’s own conscience. But it is a consolation far surpassing this, to know when men vaunt themselves over us wrongfully, that we are standing in the view of God and of the angels. (Commentaries)