The sons of King David are mentioned both as a group and singly repeatedly in the Hebrew Bible accounts of the reigns both of David and his successor Solomon
The number of sons mentioned by name in the Hebrew Bible are 19. In addition two further unnamed sons are recorded as having been born in Jerusalem, presumably having died in infancy. One of these is the first child of David's adulterous relationship with Bathsheba. Only one of David's daughters is mentioned by name, Tamar (daughter of David).
The named sons are as follows. First those born in Hebron:
Amnon, David's firstborn, born in Hebron to Ahinoam of Jezreel. Absalom killed him after he raped Absalom's full sister, Tamar.Kileab (or Daniel), second son, whose mother was Abigail from Carmel. He probably died young since there is no record of his life.Absalom, the third son, born to Maacah, the daughter of Talmai, king of Geshur. He was killed by Joab (1 Chronicles 3:1-2) after he mounted a rebellion against his aging father David.Adonijah, the fourth son of King David from Haggith (2 Samuel 3:4). He made a play for the throne after the death of David. Solomon had him executed (I Kings 2:13-25)Shephatiah, whose mother was Abital.Ithream, whose mother was Eglah, "David’s wife."The sons born to David in Jerusalem included the sons of BathshebaThe infant who died without being namedShimea, or Shammua, probably the first surviving child of BathshebaShobab, from BathshebaNathan (son of David), Bathsheba the ancestor of Jesus according to the Genealogy of Jesus in Luke 3:31, considered by some to be the maternal line via Heli, possible father of Mary.Solomon, Bathsheba, the ancestor of Jesus according to the Genealogy of Jesus in Matthew, often considered to be Joseph's line.Nine other sons from other wivesIbhar, Elishua, Elpelet, Nogah, Nepheg, Japhia, Elishama, Eliada, and Eliphelet, and one further unnamed son, who would also have died in infancy.