MySQL - Statement vs PrepareStatement

总结

Statement很容易被SQL注入,详见:https://blog.csdn.net/meism5/article/details/90414125

因此java引入PrepareStatement来预防sql注入,原理如下图。

 

 

 

Statement 使用

 

 

 

PrepareStatement 使用

 

posted on 2020-11-27 23:13  frank_cui  阅读(109)  评论(0编辑  收藏  举报

导航

levels of contents