title: Get BLOB from database, how to put them back
body: <p>I got the BLOB data from the database and use the below code to put it into a string(rs is the ResultSet, file is a Map), is there a way to put this string value back to the BLOB columns?</p>
  
  <pre><code>                    Blob blob = rs.getBlob("FILE_DATA");
                      if(blob != null) {
                          byte[] bdata = blob.getBytes(1, (int) blob.length());
                          String data = new String(bdata);
                          file.put("FILE_DATA", data);
                      }
  </code></pre>
  
  <p>I have tried some suggestions like this one, but they don't work well.</p>
  
  <pre><code>            Blob blbVal = getConnection().createBlob();
              byte[] fileData = value.toString().getBytes();
              blbVal.setBytes(1, fileData);
              cs.setBlob(index, blbVal);
  </code></pre>