EJB design: reading different types of files from blob!!!

  1. reading different types of files from blob!!! (3 messages)

    In my oracle database, I have got table in which i have got a blob column contains files of different type(ex: gif,doc,txt,pdf,....) Now how can write a single java program to read file of any type.Please explain me!!!
  2. What do you mean by "read file of any type?" Do you mean you want a single program to interpret each binary format and display the file?
  3. That's right! I need to write a single program to read the binary files and diplay the file
  4. Given just the binary stream, it may be tough to determine what kind of data it represents - unless you know the formats of each type and are willing to do some bit level matching.
    If you are storing the type of the BLOB (i.e pdf, gif) as an additional type item, maybe you can try saving the binary object as a file and then launching an appropriate reader (say acrobat for pdf etc) to read that file. I'm not sure if this is what you are looking for, though.