首页>>帮助中心>>香港VPS的ibatis怎么防止sql注入

香港VPS的ibatis怎么防止sql注入

2023/5/24 452次

香港VPS的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},+'%'

一诺网络香港免备案专区,提供「香港增强VPS」和「香港特惠VPS」两种类型的高可用弹性计算服务,搭载新一代英特尔®至强®铂金处理器,接入CN2低延时高速回国带宽线路,网络访问顺滑、流畅。机房网络架构采用了BGP协议的解决方案可提供多线路互联融合网络,使得不同网络运营商线路的用户都能通过最佳路由实现快速访问。