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 in Islam
David's narrative in the Qur’an, in many respects, parallels that given in the Bible. Although he is never explicitly named a prophet ("nabī") or a messenger ("rasūl"), David is included in lists of those who received revelation ("waḥy"; 4:163) or guidance ("hudā"; 6:84) from God. In both lists his name appears next to that of his son Solomon. Elsewhere, the Quran explains that God gave to both of them the gifts of "sound judgment" ("ḥukm"; 21:79) and "knowledge" ("ʿilm"; 21:79; 27:15). Yet the Quran also ascribes to David merits that distinguish him from Solomon: David killed Goliath (2:251) and received a divine revelation named the Psalms (17:55 uses an indefinite form while 21:105 uses the definite form "al-zabūr"), presumably a reference to the Psalms or the Psalter (the term "zabūr" is perhaps related to Hebrew "mizmōr" or Syriac "mazmūrā", "psalm"). The mountains and the birds praised God along with David (21:79; in 34:10 God commands them to do so; cf. Psalm 148:7–10). God made David a "vicegerent" ("khalīfa"; 38:26), a title that the Quran otherwise gives only to Adam (2:30). This title suggests that, to the Quran, David was something more than a messenger: he was a divinely guided leader who established God’s rule on earth. This role is also suggested by 2:251: "God gave him authority ("mulk") and wisdom ("ḥikma") and taught him what He willed. If God did not drive back some people by others, the earth would become corrupt."