private static String hexString = "0123456789ABCDEF";
private static String encode(String str) {
try{
// 根据默认编码获取字节数组
byte[] bytes = str.getBytes("UTF-8");
StringBuilder sb = new StringBuilder(bytes.length * 2);
// 将字节数组中每个字节拆解成2位16进制整数
for (int i = 0; i < bytes.length; i++) {
sb.append(hexString.charAt((bytes[i] & 0xf0) >> 4));
sb.append(hexString.charAt((bytes[i] & 0x0f) >> 0));
}
return sb.toString();
}catch(Exception e){
e.printStackTrace();
}
return "";
}
if(n_content!=null&&!n_content.equals("")){
n_content = encode(n_content);
sql.append(" AND dbms_lob.instr(N_CONTENT,'"+n_content+"',1,1)<>0 ");
}