Comments - How to escape backslash in an insert statement
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
2) is correct. The string needs to be escaped in java (so backslash gets doublebackslash) and in SQL (so doublebackslash gets 4-backslash)
you also can use hex. constants , e.g 0x5C