Elhanan, son of Jair
Elhanan son of Jair-Oregim the Bethlehemite ( "’Elḥānān ben-Ya‘rê ’Ōrəḡîm Bêṯhallaḥmî") appears in 2 Samuel 21:19, where he is credited with killing Goliath. As this contradicts the better-known story in 1 Samuel 17 in which it is the famous David who kills Goliath, the 4th century BC Book of Chronicles explains the second Goliath by saying (20:5) that Elhanan "slew Lahmi the brother of Goliath", possibly constructing the name Lahmi from the last portion of the word "Bethlehemite" (""beit-ha’lahmi"). The King James Bible translators modified 2 Samuel 21:18–19 to make it read as if Elhanan had slain Goliath's brother: "And there was again a battle in Gob with the Philistines, where Elhanan the son of Jaare–oregim, a Beth–lehemite, slew "the brother of" Goliath the Gittite, the staff of whose spear was like a weaver's beam", although the Hebrew text at this point makes no mention of the word "brother"; the medieval Jewish authors of the Targum Jonathan solved the problem by explaining Elhanan as an alternative name for David. However, this makes it difficult to explain why David is called "Elhanan" in verse 19 but consistently "David" in the verses that surround it (15, 16, 17, 21, 22). The most widely accepted explanation is that the storytellers have displaced the deed from the obscure Elhanan to the more famous character, David.
David
Apart from these, all that is known of David comes from the biblical literature. The Books of Samuel were substantially composed during the time of King Josiah at the end of the 7th century BCE, extended during the Babylonian exile (6th century BCE), and substantially complete by about 550 BCE, although further editing was done even after then—the silver quarter-shekel which Saul's servant offers to Samuel in 1 Samuel 9 "almost certainly fixes the date of the story in the Persian or Hellenistic period". The authors and editors of Samuel drew on many earlier sources, including, for their history of David, the "history of David's rise" (1 Samuel 16:14–2 Samuel 5:10), and the "succession narrative" (2 Samuel 9–20 and 1 Kings 1–2). The Book of Chronicles, which tells the story from a different point of view, was probably composed in the period 350–300 BCE, and uses Samuel as its source.