Joab told David to come and camp against the city and take it because Joab said if he took the city it would be named after him.