Object ob = dataList.get(i)[j]; String str = null; if(ob instanceof SerializableClob){ SerializableClob sc = (SerializableClob)ob; char[] buffer = null; try { //根据CLOB长度创建字符数组 buffer = new char[(int)sc.length()]; //获取CLOB的字符流Reader,并将内容读入到字符数组中 sc.getCharacterStream().read(buffer); } catch (Exception e) { e.printStackTrace(); } //转换为字符串 str = String.valueOf(buffer); }
转载于:https://www.cnblogs.com/zhouchunDIY/p/9389342.html
相关资源:jdbc连接例子 Oracle CLOB转换为String java调用存储过程之输出游标