MAP对象转sql怎样避免注入
MAP对象转sql避免注入的方法:
通过MAP封装例如:
SqlHelper
getUpdateSql
Map modifymap=new HashMap();
modifymap.put("taxes", taxesnew);
modifymap.put("effectiveprofit", effectiveprofitnew);
modifymap.put("field001", field001new);
modifymap.put("budgetedcost", budgetedcostnew);
modifymap.put("field002", field002new);
modifymap.put("fromdepbudget", null);
modifymap.put("requestid", workflowid);
modifymap.put("effectiveamount2", effectiveamount2);
modifymap.put("contractbudget", contractbudget);
dataService.executeSql(SqlHelper.getUpdateSql("depbudget", modifymap, " id='"+id+"' "));
本文来源:https://www.yuntue.com/post/62444.html | 云服务器网,转载请注明出处!