25He sent [a message] by the hand of Nathan the prophet, and [Nathan] called the boy's [special] name Jedidiah [beloved of the Lord], because the Lord [loved the child].
Now David had sinned with Bathsheeba, committing adultery and then murdering her husband. Their's was not a relationship established on very good things. But, out of their union- not from any of David's other wives comes Solomon, the son of wisdom, the son through whom the kingly line would continue. And his special name was Jedidiah, beloved of the Lord.
God can take our frailties and failings and carry out His plan and His purpose. That's good news!