The Bible passage never says Jesus whipped the backs of the marketers, just that he drove out the sheep and cattle and cleared the temple. Nevertheless there are plenty of examples in the bible where a weapon was used for self defense, one example is David and Goliath.
Matthew 12:29
Or else how can one enter into a strong man’s house, and spoil his goods, except he first bind the strong man? and then he will spoil his house.
And yes he did whip the money changers
Jesus Cleanses the Temple
John 2:13-16
13 The Passover of the Jews was at hand, and Jesus went up to Jerusalem. 14 In the temple he found those who were selling oxen and sheep and pigeons, and the money-changers sitting there. 15 And making a whip of cords, he drove them all out of the temple, with the sheep and oxen. And he poured out the coins of the money-changers and overturned their tables. 16 And he told those who sold the pigeons, Take these things away; do not make my Father’s house a house of trade.