PDF保存在Oracle DB中:错误-java.sql.SQLException:此类型的数据大小大于最大大小:71365

时间:2019-06-19 09:31:01

标签: java database oracle exception sqlexception

我正在尝试将PDF文件保存在Oracle DB中并使用以下代码:

foo

我正在使用 ojdbc14.jar 。 对于高达30KB的PDF文件,它工作正常,但是当我尝试保存30KB以上的文件时,它显示错误:

InputStream FILE_CONTENT = null;
Part filePart = req.getPart("pdf_file");
if (filePart != null ) {
    // prints out some information for debugging
    logger.info("File Name::"+filePart.getName());
    logger.info("File Size::"+filePart.getSize());
    logger.info("File Type::"+filePart.getContentType());

    // obtains input stream of the upload file
    FILE_CONTENT = filePart.getInputStream();

    //Insert Blob in Oracle DB
    cs.setBinaryStream(1, filePart.getInputStream(), (int) filePart.getSize());
}

请给我任何将PDF文件保存在oracle DB中的解决方案。

谢谢。

0 个答案:

没有答案