poi主要是excel,好象没有关于word的,据说正在开发中!

解决方案 »

  1.   

    POI可以只是支持交差而已
      

  2.   

    我也是正要在java中操作word,下载了poi,没有支持word的功能
      

  3.   

    http://expert.csdn.net/Expert/topic/2361/2361145.xml?temp=.4011499
      

  4.   

    我做的是把表格导入WORD并打印,图片没是试过。
      

  5.   

    可以,把word实体插入到oracle的blob中,其他的数据库的大字段中也是可以的给你一个例子首先建一个表测试一下吧create table javatest(
    name varchar(10),
    content BLOB);
    package yourpackage;
    import java.sql.*;
    import java.io.*;
    import oracle.sql.*;
    import beans.common.*;public class insertBlobBean {
      public static void main(String args[]){
        try{
         // DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         connectionMgr connectMgr=new connectionMgr();
         Connection conn=null;
         //链接数据库
         try{
           conn=connectMgr.getConnection();
         }catch(Exception e){
           System.out.println(e.toString());
         }
          
          conn.setAutoCommit(false);
          BLOB blob=null;
          //首先往BLOB中插入一个空的blob
          PreparedStatement pstmt = conn.prepareStatement("insert into javatest(name,content) values(?,empty_blob())");      pstmt.setString(1,"wyx");
          pstmt.executeUpdate();
          pstmt.close();
    //然后取出这个空的blob字段
          pstmt = conn.prepareStatement("select content from javatest where name= ? for update ");
          pstmt.setString(1,"wyx");      ResultSet rset = pstmt.executeQuery();
          if (rset.next())
            blob = (BLOB)rset.getBlob(1);
          String fileName = "f:\\1111.doc";
          File f = new File(fileName);
          FileInputStream fin = new FileInputStream(f);
          System.out.println("file size = " + fin.available());
          //更新这个字段
          pstmt = conn.prepareStatement("update javatest set content=? where name=?");
          //往blob里面写入文件
          OutputStream out = blob.getBinaryOutputStream();
          int count = -1, total = 0;
          byte[] data = new byte[(int)fin.available()];
          fin.read(data);
          out.write(data);
          /*byte[] data = new byte[blob.getBufferSize()];
            另一种实现方法,节省内存
            while ((count = fin.read(data)) != -1) {
            total += count;         out.write(data, 0, count);       }
           */
          out.flush();
          fin.close();
          out.close();      pstmt.setBlob(1,blob);
          System.out.println(blob.length());
          pstmt.setString(2,"wyx");
          pstmt.executeUpdate();
          pstmt.close();
          conn.commit();
          conn.close();
        }catch(SQLException e){
          System.err.println(e.getMessage()+e.toString());
        }catch (IOException e) {
          System.err.println(e.getMessage()+e.toString());     }
      }
    }
      

  6.   

    关于word读取显示的看看
    http://www.csdn.net/Develop/read_article.asp?id=25116或许对你有一些帮助
      

  7.   

    我也正在考虑这个问题,不过现在的这些工具好像都是直接把整篇word文档作为一个大字段
    存放到数据库中,不能以更小的粒度抽取出word中的内容分别放到数据库中.