Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Problem in retrieving Excel file from Database

 
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
Posts: 4226
33
jQuery Eclipse IDE Java
  • 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.
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic