首页 > 数据库技术 > 详细

ibatis order by 防止sql注入

时间:2016-09-09 14:52:06      阅读:1154      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!