有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

超过32767字符限制的java导出CLOB数据库字段

我尝试将表的内容从数据库导出到Excel

在表中,我有一列保存imageURI数据(超过32767个字符的限制),或者如果没有图像,可能会保留行“notavailable”

我不需要将该图像URI导出到Excel,只需检查图像是否存在,并为该特定列导出两行中的一行:“存在”(而不是单元格的值)或“不可用”(单元格的值)

下面是检查图像是否存在的代码(我使用Apache POI导出数据):

for (int i=1; i<=columnCount; i++) {
Cell dataCell = dataRow.createCell(i);
if(columnName.get(i).equals("IMAGE") && !result.getString(columnName.get(i)).equals("Not Available")){
    dataCell.setCellValue("Present");
}
else{
    dataCell.setCellValue(result.getString(columnName.get(i)));
}
}

上面的构造为我提供了java。sql。SQLException

我如何解决这个问题

谢谢

UPD:

以下结构:

for (int i=1; i<=columnCount; i++) {
    Cell dataCell = dataRow.createCell(i);
    if(columnName.get(i).equals("IMAGE")){
        dataCell.setCellValue("Present");
    }
    else{
        dataCell.setCellValue(result.getString(columnName.get(i)));
    }
    }

很好


共 (0) 个答案