Against thee, thee only, have I sinned
All sin, though committed against a fellow creature, being a transgression of the law, is against the lawgiver; and, indeed, begins at the neglect or contempt of his commandment, as David's sin did, ( 2 Samuel 12:9 ) ; and being committed against God, that had bestowed so many favours upon him, was a cutting consideration to him, which made his sorrow appear to be of a godly sort; wherefore he makes his humble and hearty confession to the Lord, and who only could forgive his sin;
and done [this] evil in thy sight;
for with respect to men it was secretly done; and was only known to God, with whom the darkness and the light are both alike;
that thou mightest be justified when thou speakest, [and] be clear
when thou judgest;
not that David committed this sin that God might be just, and pure, and holy; but this was the event and consequence of it: God, by taking notice of it, resenting it, and reproving for it, appeared to be a righteous Being, and of purer eyes than to behold sin with pleasure; see ( Exodus 9:27 ) . Or these words may be connected with his acknowledgment and confession of sin; which were done to this end and purpose, to justify God in his charge of it upon him, and in threatening him with evils on account of it, by the mouth of Nathan the prophet: or with his petitions for pardoning grace and mercy; that so he might appear to be just to his promise, of forgiving iniquity, transgression and sin, to humble penitents; and particularly that he might appear to be just and faithful to his Son, in forgiving sin for his sake; whom he had set forth, in his purposes and promises, to be the propitiation for sin, to declare his righteousness, ( Romans 3:25 Romans 3:26 ) ; see ( Romans 3:4 ) .