It is important to note, David said here in verse 23 his dead son would never return to him. David didn't have the understanding about the resurrection Jesus would later bring. (
John 11:21-26) King David lived about a thousand years
before Christ was born. David, along with he and Bathsheba's second son Solomon, both had the great honor of being used in the lineage of Jesus Christ. (
Mat 1:1 and
1:6) David's firstborn son will likely return to life; as will David.
[As a son of adultery, David's firstborn's early death likely spared him a tumultuous and maybe even troublesome life...]