Bathsheba was the wife of Uriah the Hittite until King David looked out from his rooftop and saw her bathing herself. Calling upon her, they committed adultery together and Bathsheba became pregnant. Uriah was with the army fighting for King David, and David called him home to spend time with his wife and therefore cover up what occurred. When this didn't work, he had Uriah killed. David then married Bathsheba and they had a son. No one knew what had happened, except for God.
Because of what they did, the son died. While David was comforting her for this loss, she became pregnant with Solomon. She outlived David, and saw her son Solomon become king. She is part of the line of Jesus. (Matt 1:6)