2 Samuel 12:24-25

12:24 So David comforted his wife Bathsheba. He went to her and had marital relations with her. She gave birth to a son, and David named him Solomon. Now the Lord loved the child 12:25 and sent word through Nathan the prophet that he should be named Jedidiah for the Lord’s sake.

Matthew 1:6

1:6 and Jesse the father of David the king.

David was the father of Solomon (by the wife of Uriah),