防止SQL注入 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 #+'%
【编辑推荐】
- iBATIS模糊查询的实现实例浅析
- iBATIS的多对多映射配置浅析
- iBATIS一对多映射解析
- iBATIS.NET执行存储过程实例详解
- 实战解析:如何整合iBatis和Spring
版权声明:
作者:后浪云
链接:https://www.idc.net/help/414580/
文章版权归作者所有,未经允许请勿转载。
THE END