Mabatis中模糊查询防止sql注入
摘要:
#{xxx},使用的是PreparedStatement,会有类型转换,所以比较安全; ${xxx},使用字符串拼接,可以SQL注入; like查询不小心会有漏洞,正确写法如下: Mysql: select * from user where name like concat('%', #{name 阅读全文
posted @ 2017-08-16 09:42 notonlywei 阅读(1215) 评论(0) 推荐(0)