Mybatis sql注入问题
生活随笔
收集整理的這篇文章主要介紹了
Mybatis sql注入问题
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
預編譯方式,即PreparedStatement,可以防注入:#{id}
<select id="getBlogById" resultType="Blog"parameterType=”int”>
select id,title,author,content from blog where id=#{id}
</select>
?字符串拼接方式,容易產(chǎn)生注入:${id}
<select id="getBlogById" resultType="Blog"parameterType=”int”>
select id,title,author,content from blog where id=${id}
</select>
轉載于:https://www.cnblogs.com/SEC-fsq/p/5290681.html
總結
以上是生活随笔為你收集整理的Mybatis sql注入问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 开发笔记- iOS监听某些事件的方法简单
- 下一篇: 对datatable进行linq过滤