ibatis order by 防止sql注入

(1) 排序控制sql

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

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

(2)排序字段input

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

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

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

相關文章
相關標籤/搜索