今天在大批量操作数据时,遇到此问题,解决如下:
1 if(cateName.indexOf("‘")!=-1){ 2 oql = " select * where name = ‘"+cateName.replace("‘", "‘‘")+"‘ "; 3 }else{ 4 oql = " select * where name = ‘"+cateName+"‘ "; 5 }
先对参数进行判断,当参数中含有单引号时,用"‘‘"替换单引号;
原文地址:https://www.cnblogs.com/coder-wf/p/12192270.html
时间: 2024-10-27 21:23:54