ibatis order by 防止sql注入
Posted 南田玉彦
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ibatis order by 防止sql注入相关的知识,希望对你有一定的参考价值。
(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注入的主要内容,如果未能解决你的问题,请参考以下文章
防止sql注入:mybatis的#{}和${}的区别以及order by注入问题