ibatis防止SQL注入的办法
常见容易犯错的写法:
select * from page_frame where title like '%$title$%'
这样会引起SQL注入漏洞.
解决方法:
select * from page_frame where title like '%'||#title#||'%'
注意:以上写法在oracle使用。
在mysql中,用这个: select * from page_frame where title like CONCAT('%',#title#,'%')
在mssql中,用这个: select * from page_frame where '%'+#name #+'%
浙公网安备 33010602011771号