oracle blob过滤

前端之家收集整理的这篇文章主要介绍了oracle blob过滤前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
        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 ");
		}

猜你在找的Oracle相关文章