This information is handy for proving that David was Mary's biological grandfather.
• Rom 1:3 . . [God's] son Jesus Christ our Lord was made of the seed of David according to the flesh
The Greek word translated "seed" in that passage is sperma (sper' mah) which is a bit ambiguous because it can refer to biological progeny and/or spiritual progeny.
I think it's pretty safe to assume that the passage below is speaking of spiritual progeny.
"If you belong to Christ, then you are Abraham's seed, and heirs according to the promise." (Gal 3:29)
However; Rom 1:3 is definitely speaking of biological progeny because David's seed is according to the flesh, i.e. his body.
• Acts 2:30 . .Therefore [David] being a prophet, and knowing that God had sworn with an oath to him, that of the fruit of his loins, according to the flesh, he would raise up Christ to sit on his throne;
Greek words for "according to the flesh, he would raise up Christ" are not in the manuscripts. The KJV's editors took the liberty to pencil them into their English translation.
However, Greek words for "fruit of his loins" are in the manuscript. Those are reinforced by the wording of the oath at 2Sam 7:12 where again David's seed is clearly implied to be physical rather than spiritual.
See also Psalm 132:11 where it's said: The Lord has sworn to David, a truth from which He will not turn back: "Of the fruit of your body I will set upon your throne."