• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Query Regarding Reading Excel files at Runtime

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am storing Excel files in database. The database that I am using is Access. I have stored the Excel file as an OLE object in the database. I am required to read a Excel File at runtime from database and processing on it. I am using POI API from Apache to process the Excel files. The problem that I am facing is that POI API requires an Input Stream to the excel files for processing it. So how do I get an Input Stream to the excel files at runtime.
I tried out the following code but it is not working:
POIFSFileSystem excel = new POIFSFileSystem(new ObjectInputStream(rs.getBinaryStream("Excel")));
POIFSFileSystem excel = new POIFSFileSystem(rs.getBinaryStream("Excel"));
Where POIFSFileSystem is a class defined in the POI suite of classes and �rs� is an object of ResultSet class.
Here �Excel� is the name of the column in the database which stores excel files.
The error that I am getting it
test:java.io.IOException: Invalid header signature; read 8592825365, expected -2
226271756974174256
Regards
PK
[ January 02, 2004: Message edited by: pk kumar ]
 
You showed up just in time for the waffles! And this 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