如题。
数据库中某张表里有个clob类型的字段。
现在读取数据库中这张表的数据。。
怎么把 clob这个字段的数据写成一个xml文件。。

解决方案 »

  1.   

    CLOB 读出来 不就个string么
    然后你就写进去就OK了啊
      

  2.   

    别人的博客http://zhouyundong0482.blog.163.com/blog/static/1035179200801621823256/得到字符串后写成文件就ok
      

  3.   

    for example
    Clob data = recordset.getClob("field");
    DataInputStream dis = new DataInputStream(data.getAsciiStream());
    byte[] buf = new byte[1024];
    int len = 0;
    FileOutputStream fos = new FileOutputStream("xxx.xml");
    while ((len=dis.read(buf))!=-1) {
        fos.write(buf,0,len);
    }
    fos.close();