Preflop
Standard C-bet and also sizing, since there was a caller in between.
Flop
On this particular board its kind of unlikely, he can have anything, that beat you. 22-55, A3 or 54 would be a very loose call of your 3-bet, and QQ+ would usually 4-bet with a guy in between. I also think, a donk bet, like this is, tend to be a draw or a weak made hand far more often than a monster. So I think, you have the best hand the vast majority of the time, and for that reason I would raise with intentions to stack off, if he 3-bets. And if he just call, I would jam any turn card, thats not an A, a 3 or a club.
Turn
Thats one of those bad cards, I talked about, so now I would fold, when he continue firing. All his AX got there, and that was the majority of his
bluffing range. So for him to have a
bluff now, he would need to turn his 88 or 99 into a bluff, which seem pretty unlikely. Also you can have a lot of AX yourself, so its not like, he can bluff you to high heaven, because you fold an overpair now.
Conclusion
You ask, what you did wrong, and I dont think, you did anything really wrong. Personally I prefer raising the flop for the reasons, I already explained, but if you think, he is very bluffy and will continue firing a lot of turns, then just calling can also be fine. Ideally I would rather slowplay AA or KK, but if you want to just call with JJ, that certainly a +EV play and way better than folding. So most of all this was just a bad board runout for your hand, and if you had raised the flop, you would likely have ended up losing more.