oracle学习

public static String oracleClob2Str(Clob clob) throws Exception {
  String str = "";
  InputStream input = clob.getAsciiStream();
          int len = (int)clob.length();
          byte[] by = new byte[len];
          int i ;
          while(-1 != (i = input.read(by, 0, by.length))){
             input.read(by, 0, i);
          }
          str = new String(by);
          str=clob.getSubString((long)1,(int)clob.length());
          return str;
    }


你可能感兴趣的:(oracle)