Most of the recorded prayers of David, except for his Psalms of prayer, are very short and specific. They teach us how to pray definitely and specifically.
1 Samuel 23: 2-4
Therefore David inquired of the LORD, saying, “Shall I go and attack these Philistines?” And the LORD said to David, “Go and attack the Philistines, and save Keilah.” 3 But David’s men said to him, “Look, we are afraid here in Judah. How much more then if we go to Keilah against the armies of the Philistines?” (Continue reading from your Bible.)
1 Samuel 23: 9-12
When David knew that Saul plotted evil against him, he said to Abiathar the priest, “Bring the ephod here.” 10 Then David said, “O LORD God of Israel, Your servant has certainly heard that Saul seeks to come to Keilah to destroy the city for my sake. (Continue reading from your Bible.)
In the above prayers David and his men were being hunted down by Saul and his troops, and were in danger of their lives. Here David demonstrates his humility by putting aside his own fears as he sought to help his neighbors—the people in the city of Keilah. For the Philistines had attacked their city and were plundering their threshing floors.
So David, disregarding his own needs and fears, thought more about what God wanted him to do—whether he should go and try to deliver the people of Keilah, or not. And so he inquired of the Lord, saying, “‘Shall I go and attack these Philistines?’ And the Lord said to David, ‘Go and attack the Philistines, and deliver Keilah.’”
Notice how direct and specific David’s prayer was, and also how clear God’s answer was. But notice also that God did not guarantee that he would be victorious. He simply directed him to attack the Philistines and deliver (or try to deliver) Keilah. He gave a direct answer to David’s direct prayer—no more. In other words, David didn’t ask God if he would be victorious, so God didn’t tell him.
But we see in verse three that when David’s men indicated that they were afraid, David inquired of the Lord again, and this time God gave David assurance that He and his men would be victorious.
Well, as it happened, David went and delivered Keilah. And when Saul found out that David and his men were in the city, he began to plot against him, thinking that he would trap him in the city.
When David discovered that Saul was plotting against him, he didn’t know exactly what to do, because he didn’t know what Saul was thinking and he wasn’t sure what the people of Keilah would do if Saul came. So he prayed and asked God the two questions that were on his mind (vv. 10-12): (1) Will Saul come down after me? And (2) will the men of Keilah surrender me into Saul’s hands?
Here we see David’s very direct and bold prayer—for he asked God to tell him the future! Well, God answered his prayer. He told him that Saul would certainly come down, and that the men of Keilah were intending to surrender him over to Saul. So, with that answer, David and his men departed from Keilah and escaped from Saul’s pursuit.