SQL防注入

来源:互联网 发布:linux ps 源码 编辑:程序博客网 时间:2024/05/17 06:33
to all developer:

写sql、hql都不要直接拼参数(不管有几个参数),用占位符预编译传参;

直接拼参数,1.容易错(拼字符串参数忘了单引号)2.不能防注入;

"select xx from tbl where id="+id    (错误)

"select xx from tbl where id=?"       (正确)
0 0
原创粉丝点击