They are only attributed to him. That does not mean that he wrote them. If you can find a valid source that says that he wrote them I will gracefully accept this. If you use an apologist source then you are admitting that David did not write them.
If King David wrote the Psalms, that means that the Christian belief of Heaven wasn't taken from the Persians.