private voidGenerateModelId(String faceip,Blob Image) throws DAOException, SQLException, IOException, JSONException {
InputStream is = null;
image = dao.executeQuery("select image from xxx ",new ColunmProcessor()); // 查询到图片
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Image = (Blob)image;
is = Image.getBinaryStream();//这里也可以替换成其他输入流
byte[] b=new byte[1024];
int len = -1;
FileImageOutputStream imageOutput = new FileImageOutputStream(new File("D:\\alarmImages\\"+psncode+".jpg"));
int leng;
while ((leng=is.read(b))!=-1){
imageOutput.write(b, 0, leng);//将byte写入硬盘
}
imageOutput.close();
}
从oracle数据库 导出照片
最新推荐文章于 2023-03-31 16:49:42 发布