以下代码并不严谨,仅作示例参考:
通过Record 获取Blob字段:
Record record = dao.fetch("xxx", Cnd.where("FXUID", "=", "5I489TM9T8B0147"));
if (record != null)
Files.write(new File("D:/2." + record.getString("EXTN").toLowerCase()), record.getBlob("FL").getBinaryStream());
自定义SQL获取一个字段:
Sql sql=Sqls.create("select FL from xxx where FXUID=@FXUID");
sql.setParam("FXUID","5I489TM9T8B0147");
sql.setCallback(Sqls.callback.blob());
dao.execute(sql);
Blob blob=sql.getObject(Blob.class);
Files.write(new File("D:/123.jpg"), blob.getBinaryStream());