sql注入

Statement --------------->>>select * from 表名 where username=' username' and password=' 可填可不填  ' or 1=1 -- '  -与'之间有个空格

这样就可以登录了    说明Statement不能防止非法注入

 

PreparedStatement----------------->>>>同样的上面那个语句   不可运行   

 

posted @ 2016-04-20 20:10  李永  阅读(221)  评论(0编辑  收藏  举报