//将Blob类型的字段下载下来,以文件的方式保存在本地
Blob photo = rs.getBlob("photo");
InputStream is = photo.getBinaryStream();
FileOutputStream fos = new FileOutStream("czhangyuhao.jpg");
byte[] buffer = new byte[1024];
int len;
while((len = is.read(buffer)) != -1){
fos.write(buffer, 0, len);
}
———————————————————————————————————————————
如果指定了相关的Blob类型,还报错:xxx too large, 那么在MysqL的安装目录下,找my.ini文件加上如下的配置参数: