取出图片
Blob blob=null;
rs = ps.executeQuery();while(rs.next()){
blob= rs.getBlob("thumbnail");
// int length = (int)blob.length();
///photo= blob.getBytes(2, length);
InputStream in = blob.getBinaryStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte photo2[] = new byte[1024];
int len;
while((len = in.read(photo2)) > 0) {
baos.write(photo2, 0, len);
}
存图片
ps.setBlob(21, sus.getPhoto()); //当前为java.sql.Blob