After Jehovah reproved him through the prophet Nathan (2 Sam. 12:1-12), David repented and was forgiven by God (2 Sam. 12:13; Psa. 51:1-17).
Psalms 37 were composed according to David's concepts of a godly life. In these psalms David asked God to deal with his adversaries and be a shield around him, his glory and the One who lifted up his head (Psa. 3:1-3, 6-8). Does asking God to deal with his adversaries correspond with the New Testament teaching? Surely, it is against the New Testament teaching. The New Testament teaches us to love our enemies and pray for those who persecute us (Matt. 5:44; Luke 6:27, 35; Rom. 12:20).
I have been in the Lord's recovery for sixty years. In these sixty years, I have encountered opposition and even rebellion. How do we react to such opposition? As descendants of Adam, we would ask the Lord to deal with all these opposers for us. But if we are in the reality of the New Testament, we dare not pray this way. We cannot pray this way to the Lord because He told us to love our enemies.
David also asked the Lord to be a shield of protection around him. Is this good or bad? What is wrong with asking God to protect us? I would say that this is neither bad nor good. At that juncture when he was fleeing from his son, David prayed such a prayer. Why did he not pray, "Lord, You know I committed that sin which caused my son to be rebellious. Lord, don't condemn him. Lord, condemn me. I repent. I would like to have a time to say to my son, 'Son, forgive me. The cause of today's trouble is not you, but me.' Lord, deal with my heart." This is a spiritual prayer. Instead, David was asking the Lord to be a shield around him. As a murderer and a fornicator, was David worthy to be protected? He also asked God to be his glory and the One who lifted up his head. Should David not have felt ashamed to ask this of God when he was fleeing from his son, being chastised by God because of his murder and fornication?
David also called out to Jehovah and believed that He would answer him from His holy mountain (Psa. 3:4).
David was also praying in the night for Jehovah's sustaining (Psa. 3:5). Nearly all the Bible students and teachers call Psalm 3 a psalm of night prayer. Is praying nightly good or bad? It all depends upon how we pray. If David were really in the spirit, he would have considered the situation he was in at that time. He was fleeing from his rebellious son. He should have considered what caused his son to rebel. Then he would pray at night, "God, forgive me. It was I who caused my son to rebel. It was I who murdered Uriah, using my power and position as king to carry out conspiracy and murder. What a shame that even I robbed Uriah of his wife." As he was fleeing from his son, David should have felt shameful and repentant before God.