2 Samuel 5:19
ESV
And David inquired of the Lord, "Shall I go up against the Philistines? Will you give them into my hand?" And the Lord said to David, "Go up, for I will certainly give the Philistines into your hand."
NIV
so David inquired of the Lord, "Shall I go and attack the Philistines? Will you deliver them into my hands?" The Lord answered him, "Go, for I will surely deliver the Philistines into your hands."
NASB
So David inquired of the Lord, saying, 'Shall I go up against the Philistines? Will You hand them over to me?' And the Lord said to David, 'Go up, for I will certainly hand the Philistines over to you.'
CSB
Then David inquired of the Lord: "Should I attack the Philistines? Will you hand them over to me?" The Lord replied to David, "Attack, for I will certainly hand the Philistines over to you."
NLT
So David asked the Lord, 'Should I go out to fight the Philistines? Will you hand them over to me?' The Lord replied to David, 'Yes, go ahead. I will certainly hand them over to you.'
KJV
And David enquired of the Lord, saying, Shall I go up to the Philistines? wilt thou deliver them into mine hand? And the Lord said unto David, Go up: for I will doubtless deliver the Philistines into thine hand.
NKJV
So David inquired of the Lord, saying, “Shall I go up against the Philistines? Will You deliver them into my hand?” And the Lord said to David, “Go up, for I will doubtless deliver the Philistines into your hand.”
				
			What does 2 Samuel 5:19 mean?
David has made a habit of asking the Lord what he should do when facing a potential battle. It's likely that many kings sought favor or approval from their gods before battle. King Saul was so dependent on this religious practice that he felt the need to carry it out even after he knew that the Lord had rejected him (1 Samuel 28:5–6).David doesn't ask this as a superstition or a mere religious exercise. He asks in full dependence on the God of Israel. He doesn't ask God for victory. He first asks if God wants him to fight, and then if God will let him win. David does so repeatedly in similar moments (1 Samuel 23:2, 11; 30:8; 2 Samuel 2:1). Even if the Philistine army far outnumbers his own, he knows God will make him victorious.
David seeks an answer from the Lord by means of an oracle. He probably calls for Abiathar, the priest who has been with him for many years, to perform this ritual with the use of the Urim and Thummim, according to the instructions given in the law of Moses (Exodus 28:4–30). David would have asked the Lord a series of yes-no questions answered by casting lots.
Through this method, David learns that God will give David and his men victory. David takes his army and routs the Philistines so badly they leave behind their pagan idols. David orders his men to burn them (1 Chronicles 14:12). They are useless against God (2 Samuel 5:20).