1. btye[]转blob

  



byte[] bs = ...
Blob blob = conn.createBlob();
blob.setBytes(1, bs);

ps.setBlob(2, blob);



 

2. blob转byte[]



Blob b = resultSet.getBlob(metaData.getColumnLabel(2));
byte[] bytes = b.getBytes(1, (int)b.length());