//配置数据库连接驱动
String sql = xxxxxxxx;//要查询的sql
PreparedStatement ps = conn.prepareStatement(sql);
String path = xxxxxxx;
ResultSet rs = ps.executeQuery();
while (rs.next()) {
InputStream is = rs.getBlob(x).getBinaryStream();//x为要取的BLOB位置
FileOutputStream os = new FileOutputStream(path + "//"
+ "存放的文件名"+“.zip”);
byte[] buff = new byte[1024];
while ((is.read(buff)) != -1) {
os.write(buff);
}
os.close();
is.close();
}
ps.close();
conn.close();
是用file文件流