从数据库中检索文档

时间:2014-11-17 11:23:12

标签: java ms-access

我收到错误:"构造函数Document(ByteArrayInputStream)未定义"

以下代码段:

public static Document readfromDB(String filename) throws Exception
{

    String sql = SELECT * FROM File where FileName = '"filename +"'";
    ResultSet rs = executeQuery(sql);
    if (!rs.isBeforeFirst())
        throw new IllegalArgumentException (MessageFormat.format("No record found"));
    rs.next
    byte[] buffer = resultset.getbytes("FileContent");
    ByteArrayInputStream newStream- new ByteArrayInputStream(buffer);
    Document doc = new Document(newStream);
    return doc;
}

0 个答案:

没有答案
相关问题