温馨提示×

esapi如何防止sql注入

小新
758
2020-12-28 17:05:19
栏目: 云计算

esapi如何防止sql注入

esapi防止sql注入的方法:

设置一个过滤器,代码示例:

String sqlStr=“select name from tableA where id=”+

  ESAPI.encoder().encodeForSQL(ORACLE_CODEC,validatedUserId)

  +“and date_created”='“

  + ESAPI.encoder()。encodeForSQL(ORACLE_CODEC,validatedStartDate)+"'";

  myStmt = conn.createStatement(sqlStr);

0