0

I have stored an image in data base (mySql).I have taken the field type as blob and storing the image in string format.I successfully reciving the blob The response what i am getting is com.mysql.jdbc.Blob@34b7cdfb .Please can any one tell me how to convert it back to image and show it using jquery.Thanks in advance

Abhishek
  • 86
  • 6
  • did you get a chance to search SO . I just now searched and found : http://stackoverflow.com/questions/14610011/reading-a-blob-from-mysql-with-java – Satya Apr 13 '16 at 03:57
  • You need to add the code you used to encode it etc for anyone to help. – Harry Apr 13 '16 at 03:57
  • 2
    Possible duplicate of [Retrieve an Image stored as BLOB on a MYSQL DB](http://stackoverflow.com/questions/2150265/retrieve-an-image-stored-as-blob-on-a-mysql-db) – Johnny Willer Apr 13 '16 at 03:57
  • Just a friendly tip, you may want to read over this page: [The How-To-Ask Guide](https://stackoverflow.com/help/how-to-ask) so you can always be sure that your questions are easily answerable and as clear as possible. Be sure to include any efforts you've made to fix the problem you're having, and what happened when you attempted those fixes. Also don't forget to your show code and any error messages! – Matt C Apr 13 '16 at 04:14
  • Thanks for the quick response.This is the code i am using object.put("img",set.getBinaryStream("img")); And the response i am getting is java.io.ByteArrayInputStream@5168abd7.Now how can i convert this back to the actual image and show it.Thanks in advance. – Abhishek Apr 13 '16 at 05:02

1 Answers1

0

I advice you not to save your image in the database with time it going to slow your DBMS

ghaziksibi
  • 471
  • 3
  • 12