• Post Reply 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Problem in retrieving Excel file from Database  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
We have a requirement to store files into database and later we need to retrieve it.We need to store Excel files with contents.We have a column of type of Blob in Oracle Database 9.X.we have used OraclePreparedStatement,BLOB of oracle implementation to store the excel file content into database.the data gets stored in the database.We have used Oracle implementation of BLOB and OracleResultSet to retrieve the data from that BLOB column.After retrieving and converting into physical file ,when i tried to open the excel file,i get a popup "Unable to Read" and file gets opened,but i cud not able to find any contents in the excel file.
Please tell a suitable way to handle this type of issues.
 
author
Bartender
Posts: 4096
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you opening the file? Directly from the database, or downloaded and saved as a individual file? Without an Excel file extension name, the content/page type must be set if the file is read directly from the database else the browser won't know how to read it.

Other than that, your problem sounds like it could be programatic. Oracle doesn't usually corrupt files it stores as Blobs. Perhaps if you post some code as to how you are storing/retreiving the file.
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check which version of the Oracle JDBC drivers you are using. There were some problems with the 9i drivers for BLOBs and CLOBs. Problem goes away when you switch to the 10g drivers. Doesn't mean you have to change database versions, just talking about the JDBC driver libraries.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!