时间:2022-12-06 01:26
ibatis防止sql注入的方法:
使用#写法采用预编译方式,将转义交给数据库,则不会出现注入问题,例如:
//mysql环境
select * from test where school_name like concat('%',${name},'%')
//oracle环境
select * from test where school_name like '%'||${name},'%'
//SQL Server环境
select * from test where school_name like '%'+${name},+'%'