读书人

模糊查询 防止SQL流入

发布时间: 2012-10-06 17:34:01 作者: rapoo

模糊查询 防止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 #+'%



读书人网 >SQL Server

热点推荐