So . . . we know and have heard and read that Jesus comes from the line of King David - right? Okay - so let's trace this back to the beginning.
David becomes King and we read about his children in 2 Samuel 5:13-16 "After he left Hebron, David took more concubines and wives in Jerusalem and more sons and daughters were born to him. These are the names of the children born to him there: Shammua, Shobab, Nathan, Solomon, Ibhar, Elishua, Nepheg, Japhia, Elishama, Eliada and Eliphelet.
Now we know that Matthew starts his book off with the the genealogy of Jesus. Matthew 1:6 tells us David's father is Jesse and King David's son is Solomon. Verse 11 says "and Josiah the father of Jeconiah and his brothers at the time of the exile to Babylon." Verse 12 says "After the exile to Babylon: Jeconiah was the father of Shealtiel" and it continues until we get to verse 16 that says, "and Jacob, the father of Joseph, the husband of Mary, of whom was born Jesus, who is called Christ." (Your Bible should have a subscript for verse 11 that says, "That is, Jehoiachin" in reference to Jeconiah). Okay - so both Jehoiachin and Jeconiah are the same name.
Okay so far? Great! Let's keep going . . . Psalm 89:20 says, "I have found David my servant; with my sacred oil I have anointed him." So we know that God anointed David to become King. The Psalm continues with how God is going to protect him / crush his foes / no wicked man will oppress him, etc. God appoints him (David) as His firstborn, the most exalted of the kings of the earth; He will love him forever; His covenant will be between them forever and never fail; AND . . . "I will establish his line forever, his throne as long as the heavens endure." Nothing much new yet - right?
God continues, (vv.30-33) "If his sons [David's sons] forsake my law and do not follow my statutes, if they violate my decrees and fail to keep my commands I will punish their sin with the rod, their iniquity with flogging; but I will not take my love from him [David] nor will I ever betray my faithfulness." [Basically, God is saying that regardless of what David's sons do - God will change His feelings / covenant with David]. Further He says (vv.36-37) that "his line [David's] will continue forever and his throne endure before me like the sun; it will be established forever like the moon, the faithful witness in the sky."
Praise God - the line of David will never end!!!
Okay - bear with me - let's go to Jeremiah 22. This is a chapter about Judgment Against Evil Kings. Verses 24-27 says, "As sure as I live," declares the Lord, "even if you Jehoiachin son of Jehoiakim king of Judah, were a signet ring on my hand, I would still pull you off. I will hand you over to those who seek your life, those you bear to Nebuchadnezzar king of Babylon and to the Babylonians. I will hurl you and the mother who gave you birth into another country, where neither of you was born, and there you both will die. You will never come back to the land you long to return to."
Jeremiah continues speaking God's curse and ends with verse 30, This is what the Lord says: "Record this man as if childless, a man who will not prosper in his lifetime, for none of his offspring will prosper, none will sit on the throne of David or rule anymore in Judah."
Let's go back to verse 24 and look at the name Jehoiachin and then the subscript in your Bible says "Hebrew Coniah, a variant of Jehoiachin, also in verse 28."
Wait! What just happened here? Jeconiah / Jehoiachin and Coniah are all the the same person - called differently based upon language used.
So . . . Jehoiachin / Coniah was cursed by Jeremiah and removed from (hurled) the lineage of King David. Now remember that Matthew includes him in the geneology which is accurate. He was in the line of David and the genealogy ends with Jacob who is the father of Joseph who is the husband of Mary who was the mother of Jesus Christ.
In Luke's gospel the geneology differs. Look at Luke 3:23 where it says, "Now Jesus himself was about thirty years old when he began his ministry" (this is actually the age of the priests of the Bible when they begin their priesthood). The verse continues, "He was the son, so it was thought, of Joseph."
REMEMBER . . . Joseph was Jesus' step-father - not His blood father. Luke's description of Jesus's lineage is actually Mary's lineage - not Joseph's. If you write them side-by-side (Matthew's versus Luke's) you will see they are different. (You will also see I found a picture that shows this simply). You will also see that Mary's ancestor from David's offspring was through Nathan NOT Solomon. Therefore Jehoiachin / Coniah / Jeconiah (offspring from Solomon) was not in Mary's lineage and therefore the curse placed on him (Jehoiachin) did not affect Jesus' lineage from King David. Both Joseph and Mary were from the tribe of Judah / King of David but branched off differently at the point of David's sons - Joseph through Solomon and Mary through Nathan.