• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query Regarding Reading Excel files at Runtime  RSS feed

pk kumar
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
[ January 02, 2004: Message edited by: pk kumar ]
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!