转义oracle数据库的通配查询符,转义oracle数据库,/** * De
分享于 点击 39496 次 点评:246
转义oracle数据库的通配查询符,转义oracle数据库,/** * De
/** * Description: 处理转义字符%和_,针对ORACLE数据库 * @param str * @return */ public static String escapeStr(String str){ if(str.startsWith("%") || str.startsWith("_")){ str = "\\\\" + str; } if(str.endsWith("_")){ int index = str.indexOf("_"); str = str.substring(0, index) + "\\\\" + "_"; } if(str.endsWith("%")){ int index = str.indexOf("%"); str = str.substring(0, index) + "\\\\" + "%"; } return str; }//该片段来自于http://byrx.net
用户点评