• Post Reply Bookmark Topic Watch Topic
  • New Topic

byte array to string

 
Joshua Cloch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

Here is my problem:

I have stored many datas in a database using MySQL,some of them stored as Blob.Say,a long name of food is stored as Blob.

Now,I have to do a query and display these data,which is readable too.

Is there any jstl action or other tags to transform Blob data which can be retrieved as byte array or binarystream to origial string value in jsp?

Thanks!

[BPSouther: changed title before moving to IO Streams forum]
[ August 06, 2006: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Blob is a database concept and shouldn't come anywhere near a JSP page. The conversion of data types like clobs, blobs and SQL dates to "everyday" counterparts should be handled in the model code and never come near the presentation code.
 
Joshua Cloch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes,but,sometimes it is needed.all right,maybe the only way is to design a custom tag
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I were working on this, I would first focus on converting a binary stream or byte array into a string. Once I got that working in a small, standalone Java app, I would figure out how best to use that code in my webapp; servlet, helper bean, custom tag, etc.

Since the first task at hand is not JSP specific, I'm going to move this thread to the IO/Streams forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!