How does a PreparedStatement avoid or prevent SQL injection?

前端 未结 10 1685
再見小時候
再見小時候 2020-11-22 05:21

I know that PreparedStatements avoid/prevent SQL Injection. How does it do that? Will the final form query that is constructed using PreparedStatements will be a string or o

10条回答
  •  无人及你
    2020-11-22 05:30

    In Prepared Statements the user is forced to enter data as parameters . If user enters some vulnerable statements like DROP TABLE or SELECT * FROM USERS then data won't be affected as these would be considered as parameters of the SQL statement

提交回复
热议问题