Bathsheba was originally the wife of Uriah and later became the wife of David and the mother of Solomon. While Uriah was away on military duty, David seduced Bathsheba. To cover up the ensuing pregnancy, David summoned Uriah from the battlefield, pretending to seek an update on the army's progress, and tried to persuade him to go home and sleep with Bathsheba. However, Uriah, adhering to ritual abstinence, refused. In desperation, David arranged for Uriah to be placed on the front lines, where he was killed. After Uriah's death, David married Bathsheba.
The prophet Nathan denounced this marriage and foretold the death of Bathsheba's child, which came to pass. Their second child, Solomon, was favored by God and eventually succeeded David as king instead of his older half-brother Adonijah. When Adonijah sought to marry Abishag the Shunammite, he asked Bathsheba to mediate the request to Solomon. Bathsheba conveyed the request, but Solomon denied it and executed Adonijah for his audacity. References: 2 Sam 11:2-12:25; 1 Kings 1:11-31; 2:13-25; 1 Chronicles 3:5; Ps 51.
Bathsheba does appear in the genealogy of Jesus but is not mentioned by name: "Matt 1:6 Jesse became the father of King David. David the king became the father of Solomon by her who had been Uriah’s wife." See the discussion in Women in the Genealogy of Jesus (1:3-6),