Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

hi

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hi sir, i have set the image in database.while getting that image in jsp it is showing the text as like this [com.mysql.jdbc.Blob@694f12, com.mysql.jdbc.Blob@345b43, com.mysql.jdbc.Blob@153b2cb]
[com.mysql.jdbc.Blob@694f12, com.mysql.jdbc.Blob@345b43, com.mysql.jdbc.Blob@153b2cb]
[com.mysql.jdbc.Blob@694f12, com.mysql.jdbc.Blob@345b43, com.mysql.jdbc.Blob@153b2cb]. so how could i solve this , please send solution for this problem'

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Sir, please take a look at this topic, it's the same problem.

You don't write the Blob object to the client, because this way it's toString() method will be called, which does not return the bytes of the image. And you don't write the bytes of the image in the same stream that contains the HTML code either (it's possible to embed the image's data in HTML, but not every browser supports this). You create a separate servlet/controller instead that outputs just the requested image's data, see the other topic!

Next time please UseAMeaningfulSubjectLine!
 
Ranch Hand
Posts: 471
Mac OS X Hibernate Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
1- This is not a spring question
2- You have to get this blob as a byte array, and send it to the user with the response having a header saying that this is of a mime type image, for example , then you write the byte array to the OutputStream of the response. I believe that you'll need have a separate controller (separate URL to be precise) to do this for each image
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please read this for more information.
    Bookmark Topic Watch Topic
  • New Topic