1. 程式人生 > >abatis防止sql攻擊

abatis防止sql攻擊

為了防止SQL注入,iBatis模糊查詢時也要避免使用$$來進行傳值。下面是三個不同資料庫的ibatis的模糊查詢傳值。


# mysql: select * from stu where name like concat('%',#name #,'%')
#
# oracle: select * from stu where name like '%'||#name #||'%'
#
# SQL Server:select * from stu where name like '%'+#name #+'%