David being in great distress and danger by the malice of his enemies, does, in this psalm, by prayer address himself to God, his tried refuge, and seeks shelter in him. I. He appeals to God concerning his integrity, Ps. 17:1-4. II. He prays to God still to be upheld in his integrity and preserved from the malice of his enemies, Ps. 17:5-8, 13. III. He gives a character of his enemies, using that as a plea with God for his preservation, Ps. 17:9-12, 14. IV. He comforts himself with the hopes of his future happiness, Ps. 17:15. Some make him, in this, a type of Christ, who was perfectly innocent, and yet was hated and persecuted, but, like David, committed himself and his cause to him that judgeth righteously.