模糊查询怎样解决sql语句注入问题
模糊查询解决sql语句注入问题的示例:
使用mysql中concat函数可以解决SQL注入又能够在位置文件中写%,代码以下:
<selectid="selectByName"resultType="cn.test.domain.Employee">select
id,emp_nameasempName,
sex,email,birthday,address
from
t_employee
where
emp_namelikeconcat(‘%‘,#{empName},‘%‘)
</select>
本文来源:https://www.yuntue.com/post/61745.html | 云服务器网,转载请注明出处!

微信扫一扫打赏
支付宝扫一扫打赏