Here are some pictures of modern day Amman, Jordan. This is where Rabbah, the capital of the Ammonites was when Joab attacked it.

Yikes...there is a Marriot in Amman!!!!
David has restored peace, and now we are going to read how some very human struggles affect even a great Christian who loves the Lord with all his heart......
We open with it being spring. Kings are supposed to go to war during this time, but David remained in Jerusalem. David is not where he is supposed to be.
David can't sleep and takes a walk and notices a beautiful woman bathing.....my NSRV says that David's palace was high on a hill looking down, so it would not be impossible for David to see the goings on of his city....David has some plain and simple lust and falls into sin. He gets Bathsheba to sleep with him. She was put into a position...what do you do when the king wants this? She can't disobey without consequence. Note that it says (she had purified herself from her uncleanness) This was her period....the reason that this is in here is because it was pointing out that she was not pregnant from her husband......Oh what a tangled web we weave....David has to fix this, so he sends Uriah, her husband out to battle specifically to be murdered. He was and Bathsheba became his wife.
Great, now the prophet Nathan has to go rebuke the king......not a fun thing. Nathan tells a parable that David could perhaps relate to since he was a shepherd boy. Rich man stills the one and only precious sheep from a poor man. David is righteously angry when he doesn't know that the story is about him. David, the adulterer and murderer truly repents. This is his best quality.....when he knows he is wrong, he admits it to God. God still has plans for David. However, Nathan tells David that the sword will never depart from his house....you are going to see this prophecy fulfilled many times over with David's children. David and Bathsheba's baby dies as punishment.
Note that David doesn't continue to dwell on his sin. He truly repented. There may be consequences, but David bore no false guilt when he truly gave it all to God and knew his forgiveness. David and Bathsheba have a fourth son that they name Solomon....the Lord names him Jedidiah, which means loved by the Lord.....the Lord shed his grace on David and Bathsheba.
Gotta love Joab....he sends a messenger to David saying, Hey, I got this city held (Rabbah)....if you don't come, I'll take credit for it myself" and David went.....
The 1 Chronicles 20 account shows that the Phillistines were also defeated.