This answer is based on the theology of Emanuel Swedenborg (1688-1772), and represents the views of the "Swedenborgian" or "New Church" denominations that accept his theology.
Note that this theology is outside the mainstream of traditional Christian theology in that Swedenborg rejected the doctrine of the Trinity of Persons, holding instead that the Father, Son, and Holy Spirit form a Trinity within a single Person of God. So this answer specifically does not offer the viewpoint of traditional Catholic, Protestant, or Orthodox Christianity.
Swedenborg did teach that Jesus Christ is fully God and fully human. As explained in another of my answers here on Christianity.SE linked near the end of this answer, this happened through a process that is at the heart of the current question.
The Biblical Background
First, let's look at some of the Bible passages that are at the heart of this question.
Does the Bible say that the Messiah is the seed of David?
The Messiah in the Old Testament
It is important to know that the Hebrew word translated "Messiah" in a few instances in traditional translations of the Old Testament (such as in Daniel 9:25-26 in the KJV) is מָשִׁיחַ (mashiyach), meaning "anointed"—which is how it is almost always translated. This word refers to the practice of anointing with oil a new king (or priest) as a sign of that person's kingship (or priesthood).
So the Old Testament passages quoted to show that the Messiah would be the seed of David don't really use the term "Messiah" as we think of it today. Rather, they were prophecies of a future king, or line of kings, who would come from the lineage of David.
Here are some of the relevant passages.
In 2 Samuel 7:12-16, as part of a longer speech, God says to King David:
When your days are fulfilled and you lie down with your ancestors, I will raise up your offspring after you, who shall come forth from your body, and I will establish his kingdom. He shall build a house for my name, and I will establish the throne of his kingdom forever. I will be a father to him, and he shall be a son to me. When he commits iniquity, I will punish him with a rod such as mortals use, with blows inflicted by human beings. But I will not take my steadfast love from him, as I took it from Saul, whom I put away from before you. Your house and your kingdom shall be made sure forever before me; your throne shall be established forever.
Psalm 89 is also read as a prophecy of the Messiah. Here is the most relevant part (Psalm 89:35-37):
Once and for all I have sworn by my holiness;
I will not lie to David.
His line shall continue forever,
and his throne endure before me like the sun.
It shall be established forever like the moon,
an enduring witness in the skies.
And from Jeremiah (Jeremiah 23:5-6):
The days are surely coming, says the Lord, when I will raise up for David a righteous Branch, and he shall reign as king and deal wisely, and shall execute justice and righteousness in the land. In his days Judah will be saved and Israel will live in safety. And this is the name by which he will be called: "The Lord is our righteousness."
There are more, but these are fairly representative passages from which the tradition grew that there would be a future Messiah who would be "the seed of David," meaning in David's biological lineage.
As you can see, it's not nearly as cut-and-dried as many Christians believe. There is no single passage in the Old Testament that says, "There will be a Messiah from the seed of David." There are, rather, various prophecies of an enduring Davidic dynasty, and of a future righteous king in the line of David. These have been woven together to form a prophecy of a great "Messiah" who was to come at some future time and re-establish the kingdom of Israel.
The Messiah in the New Testament
By the time of Christ, that tradition and expectation had been firmly established in Jewish culture. This is reflected, for example, in John 7:40-44:
On hearing his words, some of the people said, "Surely this man is the Prophet."
Others said, "He is the Messiah."
Still others asked, "How can the Messiah come from Galilee? Does not Scripture say that the Messiah will come from David's descendants and from Bethlehem, the town where David lived?" Thus the people were divided because of Jesus. Some wanted to seize him, but no one laid a hand on him.
Based on the prophecy and belief in a future great Messiah who would be from the seed of David, the genealogies of Jesus Christ in Matthew 1:1-17 and Luke 3:23-38, though they differ radically from each other from David to Jesus, both trace Jesus' lineage through David.
However, both of these lineages are presented as the lineage of Joseph, not Mary. So although they establish a quasi-patrilineal genealogy from King David for Jesus through his adoptive father Joseph, they do not establish a genetic lineage. Joseph is definitively stated not to be Jesus' biological father in Matthew 1:18-21 and Luke 1:26-38.
To solve this perceived problem, it has become traditional in some parts of Christianity to state that the genealogy in Luke is actually Mary's genealogy, not Joseph's, and that Mary is also a descendant of David.
However, this is nowhere stated in Scripture itself. Both genealogies are presented in the Bible as the genealogy of Joseph, not Mary (see Matthew 1:16; Luke 3:23).
Mary herself was more likely to have been from the tribe of Levi, not the tribe of Judah (David's tribe), since she was a relative of Elizabeth (see Luke 1:36), who was a descendant of Aaron, a Levite and the first High Priest (Luke 1:5):
In the time of Herod king of Judea there was a priest named Zechariah, who belonged to the priestly division of Abijah; his wife Elizabeth was also a descendant of Aaron.
This means there is no firm Biblical basis for the traditional Christian belief that Jesus was genetically descended from David. The Bible establishes only that his adoptive father Joseph was a descendant of David.
Jesus denied that the Messiah was the son of David
Further, Jesus himself rejected the idea that the Messiah was a son of David in this somewhat cryptic passage (Matthew 22:41-46):
While the Pharisees were gathered together, Jesus asked them, "What do you think about the Messiah? Whose son is he?"
"The son of David," they replied.
He said to them, "How is it then that David, speaking by the Spirit, calls him 'Lord'? For he says, 'The Lord said to my Lord: "Sit at my right hand until I put your enemies under your feet."' If then David calls him 'Lord,' how can he be his son?" No one could say a word in reply, and from that day on no one dared to ask him any more questions.
Jesus is here quoting from Psalm 110:1. See also the parallel passages in Mark 12:35-37 and Luke 20:41-44.
Though the force of Jesus' argument based on the first stanza of Psalm 110 is somewhat obscure, the clear message is that Jesus—shockingly to the ultra-orthodox Pharisees with whom he had this conversation—denied that the Messiah was the son of David.
In short, not only is there no clear Biblical basis for the idea that Jesus is physically a descendant of David, but Jesus himself rejects that idea.
Yes, Jesus was hailed by the people as the Messiah, who was the promised king in the line of David. But according to the Gospels' own account, this can only be a symbolic lineage, because the Gospels never speak of Jesus being literally, physically descended from King David. In fact Jesus himself denies that he is the son of David.
Is Jesus the Son of David, or the Son of God?
All of this sets the stage for the solution, according to Swedenborg's theology, to the apparent contradiction between Jesus being the son of David and Jesus being the Son of God, or God himself.
Here is the short version:
- Jesus is the son of David only symbolically, not literally and physically.
- Jesus is not only the Son of God, but is God himself in human form.
Was Jesus a king in the line of David?
As you can see from Jesus' own words quoted above, Jesus himself denied that he, the Messiah, was the son (meaning a descendant) of David.
Further, when asked point blank by Pilate whether he was the King of the Jews, Jesus denied that his kingdom was a worldly kingdom, like that of David (John 18:33-38):
Pilate then went back inside the palace, summoned Jesus and asked him, "Are you the king of the Jews?"
"Is that your own idea," Jesus asked, "or did others talk to you about me?"
"Am I a Jew?" Pilate replied. "Your own people and chief priests handed you over to me. What is it you have done?"
Jesus said, "My kingdom is not of this world. If it were, my servants would fight to prevent my arrest by the Jewish leaders. But now my kingdom is from another place."
"You are a king, then!" said Pilate.
Jesus answered, "You say that I am a king. In fact, the reason I was born and came into the world is to testify to the truth. Everyone on the side of truth listens to me."
"What is truth?" retorted Pilate. With this he went out again to the Jews gathered there and said, "I find no basis for a charge against him."
Traditional Christian theology generally holds that at his Second Coming, Christ will come and establish his rule over this world. But here Jesus specifically says, "My kingdom is not of this world." Instead, he says that his kingship is the kingship of truth.
Pilate clearly understood that Jesus was not claiming to be a worldly king, and thus was not a claimant to the Jewish kingship, which would have been in conflict with Roman law. That's why, after this conversation, Pilate went out to the people and said, "I find no basis for a charge against him."
So once again, there is no Biblical warrant for the idea that Jesus is, or ever will be, a worldly king in the line of David. That idea is based on Christian traditions, and on traditional Christian methods of interpreting the Bible, not on the statements of Jesus Christ himself, or of the Bible generally.
By Jesus' own statements, then, and according to the relevant passages in the Bible, Jesus Christ is not physically the son of David.
Instead, Jesus Christ is a spiritual king who was represented in symbolic form by King David.
King David is not the father of Jesus. Rather, to borrow a phrase from Hebrews 10:1, David was "only a shadow of the good things to come and not the true form" of that reality. David was only a human being who served for a time as the Israelites' greatest king. Jesus Christ is the true, divine king, because he is God himself come to earth to establish the true, spiritual government of divine truth.
Jesus was the Son of God, and was God himself in human form
According to Swedenborg's theology, God was not only Jesus' Father, but by the time of Jesus' resurrection and ascension to the Father, Jesus Christ was fully God, and was one with the Father, just as he says in John 10:30.
However, detailing this would double or triple the length of this already long answer. Instead, please see the explanation contained in my answer to this question: How does the Swedenborgian Church explain passages where Jesus talks/prays to the Father? There you will find it explained how Jesus could be physically the son of Mary, yet also be the Son of God, and God himself in human form.
For a more general explanation of the Father, Son, and Holy Spirit, and Jesus' mission of redemption on earth, please see my article: Who is God? Who is Jesus Christ? What about that Holy Spirit?