Java - escape string to prevent SQL injection

前端 未结 12 2270
庸人自扰
庸人自扰 2020-11-22 01:58

I\'m trying to put some anti sql injection in place in java and am finding it very difficult to work with the the \"replaceAll\" string function. Ultimately I need a functio

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 02:43

    If you are using PL/SQL you can also use DBMS_ASSERT it can sanitize your input so you can use it without worrying about SQL injections.

    see this answer for instance: https://stackoverflow.com/a/21406499/1726419

提交回复
热议问题