Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/08/2012, 12:49
filorio_miguel
 
Fecha de Ingreso: agosto-2012
Ubicación: Aguascalientes
Mensajes: 3
Antigüedad: 11 años, 8 meses
Puntos: 1
Respuesta: No guarda en el campo Blob

Después de tanto buscar por fin encontré la solución, se las dejo por si alguien le sirve:

try {
conection.setAutoCommit(false);
pstmt=conection.prepareStatement(query);
File file1 = new File(Ruta);//prueba
InputStream in = new FileInputStream(file1);
byte[] zipped = new byte[(int) file1.length()];
in.read(zipped);
BLOB blob = BLOB.createTemporary(conection, true, BLOB.DURATION_SESSION);
OutputStream blob_os = blob.getBinaryOutputStream();
blob_os.write(zipped);
blob_os.flush();
pstmt.setBlob(1,blob);
pstmt.executeUpdate();
in.close();
pstmt.close();
pstmt=null;
conection.commit();
} catch(SQLException ex) {
conection.rollback();
} finally {
if (pstmt != null)
pstmt.close();
}
return;
};

Gracias Isakmtz por tu tiempo.