Where does it say how doubtful is the whole story? I did read this howerver"
The question of David's historicity therefore becomes the question of the date, textual integrity, authorship and reliability of 1st and 2nd Samuel. Since Martin Noth put forward his analysis of the Deuteronomistic History biblical scholars have accepted that these two books form part of a continuous history of Israel, compiled no earlier than the late 7th century BC, but incorporating earlier works and fragments. Samuel's account of David "seems to have undergone two separate acts of editorial slanting. The original writers show a strong bias against Saul, and in favour of David and Solomon. Many years later, the Deuteronomists edited the material in a manner that conveyed their religious message, inserting reports and anecdotes that strengthened their monotheistic doctrine. Some of the materials in Samuel I and II , notably the lists of officers, officials, and districts are believed to be very early, possibly even dating to the time of David or Solomon. These documents were probably in the hands of the Deuteronomists when they started to compile the material three centuries later."[36]