码迷,mamicode.com
首页 > 数据库 > 详细

ibatis order by 防止sql注入

时间:2016-09-09 14:52:08      阅读:317      评论:0      收藏:0      [点我收藏+]

标签:

(1) 排序控制

select TABLE_NAME, TABLESPACE_NAME from user_tables order by TABLE_NAME $ordertype$

Where the user input ordertype ASC, DESC. On this keyword, use the $ordertype: SQLKEYWORD$ replacement $ ordertype $.

(2)排序字段

sql statement metadata. If the sql statement, there is user input metadata. Table name, field names and so on.

For example the following sql:
select TABLE_NAME, TABLESPACE_NAME from user_tables order by $ orderByColumn $.

Which is the field in the database orderByColumn. Of this metadata, use: $ orderByColumn: METADATA $ replacement $ orderByColumn $.

ibatis order by 防止sql注入

标签:

原文地址:http://www.cnblogs.com/hsuchan/p/5856299.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!