zoukankan      html  css  js  c++  java
  • 处理clob数据

     public static String ClobToString(Clob clob) {
                String clobStr = "";
                Reader is = null;
                 try {
                       is = clob.getCharacterStream();
                       // 得到流
                      BufferedReader br = new BufferedReader( is);
                      String s = null;
                       s = br.readLine();
                      StringBuffer sb = new StringBuffer();
                       // 执行循环将字符串全部取出赋值给StringBuffer,由StringBuffer转成String
                       while ( s != null) {
                             sb.append( s);
                             s = br.readLine();
                      }
                       clobStr = sb.toString();
                } catch (IOException e) {
                       e.printStackTrace();
                } catch (SQLException e) {
                       e.printStackTrace();
                }
                 return clobStr;
          }
  • 相关阅读:
    查看jvm的cg情况
    什么是json
    httpclient工具类
    mysql 优化思路(1)
    mysql存取日期出问题
    springboot和tomcat jar包冲突
    递归
    如何去理解return?
    js BOM判断当前窗口是否最顶层。
    个人笔记,关于ajax 如果没有请求成功不允许再次请求的方法。
  • 原文地址:https://www.cnblogs.com/wanglao/p/11162740.html
Copyright © 2011-2022 走看看