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);