public String leerBlob(ResultSet rs,String blob){ String returndata=""; ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); BufferedInputStream bis; try { bis = new BufferedInputStream(rs.getBinaryStream(blob)); byte[] bindata=new byte[1024]; int bytesread = 0; try { if ( !rs.wasNull() ) { if ( (bytesread = bis.read(bindata,0,bindata.length)) != -1 ) { baos.write(bindata,0,bytesread); returndata= baos.toString(); } bis.close(); } } catch (IOException e) { System.out.println("leerBlob -- Se produjo un error en la consulta"); System.out.println(e.getMessage()); } } catch (SQLException ex) { System.out.println("leerBlob -- Se produjo un error en la consulta"); System.out.println(ex.getMessage()); } return returndata; }