防止SQL注入 iBatis模糊查詢
作者:佚名
為了防止SQL注入,iBatis模糊查詢時也要避免使用$$來進行傳值.下面是三個不同數據庫的ibatis的模糊查詢傳值。
為了防止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 #+'%
【編輯推薦】
責任編輯:佚名
來源:
Javaeye