aspose file tools*
The moose likes I/O and Streams and the fly likes Query Regarding Reading Excel files at Runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Query Regarding Reading Excel files at Runtime " Watch "Query Regarding Reading Excel files at Runtime " New topic
Author

Query Regarding Reading Excel files at Runtime

pk kumar
Greenhorn

Joined: Sep 30, 2003
Posts: 7
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Query Regarding Reading Excel files at Runtime