and everyone assembled here will know that The LORD does not save by sword or spear. For this is The LORD’s battle, and he will hand you over to us.”
If you read the whole account, David does use Goliath’s sword to decapitate him. He then proceeds to take the rest of his weapons and possibly his armor, too. The point here is that The Father is the one who does the saving. Any weapon he wills can bring salvation to those he chooses to protect. Any means can bring about salvation. The faith and trust of the believer is the only limitation to witnessing the Father’s majesty and strength.