You made a few mistakes here IMO:

1. as mentioned, fold it pre-flop. Hideous hand. My friend calls a jack with any low card "jackshit," and I think that's a very appropriate title.
2. Raise the flop. You think you're ahead, put a raise in.
3. Why did you eventually flat call the turn? Again: you have the best hand, you have a guy raising you with a worse hand, and another guy flat-calling with a probable draw. Go all in. End the suspense. The draw might fold and then you aren't in here posting this, you're happily counting your chips instead.

One additional note - any time there are three participants in a pot, and two of them are betting/raising while one of them is just calling everything, that guy is about 95% likely to be on a flush draw or open-ended straight draw. Examine the board and see where it is. This time the flop was JQx rainbow, so he's either got KT or T9. It's a virtual certainty.