Witcher 2 is not great. But I don't think you need either for the third game. There is some political themes that carry over from the second game, but that's about it. The scoia'tael are in the background, the Lodge is broken, and it's easy to mix up the kings even if you have played 2. Seriously, i don't remember who Radovid is. And who was the king Saskia supported? Was that Radovid?! I don't even know, they all look alike.
Really, even the first game seems to pick up from the books. Like who the balls is Triss and why is she suddenly sleeping with me?! Why is Kaer Morhen a steaming pile?!
But the third game is just all about Ciri who isn't even mentioned in the previous games. Witcher 3 does ask you questions about the choices you made in the previous game, but whatever, you can just make it up. There are continued subplots but you can still easily enjoy it without being too confused, plus there are still plenty of books and glossary pages to read for lorelorelore.