There probably was a ruler named David, although no concrete evidence has been found as yet. The capture and purchase of Jerusalem would have occurred c. 1004BC. So David did not found Jerusalem, he settled it with Israelites and made the Jebusites serfs, allowing them to cohabit. Records of a settlement in that area date from c. 3000BC, long before evidence of Hebrew migration. Genesis relates the visit to Jerusalem by Abraham, at which time the ruler is named Melchizedek. Historically, there is proof that a king named Abdu-Heba ruled "Urusalim" (as the city is called in the Amarna letters) at the time of Pharaoh Akhnaton. In a text dated c. 1350BC, Abdu-Heba begs Akhnaton to send archers to protect the city from the "Hapiru" (Hebrew?) marauders. Biblical evidence proving that Jebusites ruled the city before David appears in Samuel. These are just a few references. Online, there is a brief, very readable "King David and Jerusalem: Myth and Reality."
from the article: Likud urges Shas, Lieberman to quit gov't over PM's 'intention'