You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Halász Bálint <Ha...@iqsys.hu> on 2004/02/04 16:26:17 UTC
Reading documents(excel) from Database
Hi,
I am newbie in POI.
My primary question is :
- Is it possible to load document(excel) from database? And if yes how?
I am asking this because from the doc and API it is not quite clear the
<http://jakarta.apache.org/poi/apidocs/org/apache/poi/poifs/filesystem/POIFSFileSystem.html#POIFSFileSystem(java.io.InputStream)> POIFSFileSystem(java.io.InputStream stream)
can handle inputreams coming from source other than filesystem.
Thanx for the help in advance,
Balint
Re: Reading documents(excel) from Database
Posted by av...@itellix.com.
Yeah, what Chris says is absolutely correct. What you should watch out for is to
ensure (since we are dealing with a binary format) that the fidelity of the file
is not compromised on its way to and from any storage system.. for eg, no extra
bytes are prepended to the stream... I mention this coz we've seen many bug
reports due to this.
Regards
-
Avik
Quoting Chris Cheshire <cc...@bigredwire.com>:
> An InputStream is just a stream that you can read from. Don't think of
> it in terms of a filesystem, that is just one small use of it. All POI
> is concerned about is being able to read from the stream. It could come
> from a local file, it could come from data read over a socket.
>
> If you store the spreadsheet as a blob in the database, you can then
> retrieve it via a normal sql query, and grab an inputstream from the
> java blob and use it in the POI libraries.
>
> Of course this ultimately depends on whether the database you are using
> has blob functionality implemented, and their java drivers can handle it.
>
> HTH
>
> Chris
>
> Halász Bálint wrote:
> > Hi,
> >
> > I am newbie in POI.
> > My primary question is :
> > - Is it possible to load document(excel) from database? And if yes how?
> >
> > I am asking this because from the doc and API it is not quite clear the
> >
>
<http://jakarta.apache.org/poi/apidocs/org/apache/poi/poifs/filesystem/POIFSFileSystem.html#POIFSFileSystem(java.io.InputStream)>
> POIFSFileSystem(java.io.InputStream stream)
> > can handle inputreams coming from source other than filesystem.
> >
> > Thanx for the help in advance,
> > Balint
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org
Re: Reading documents(excel) from Database
Posted by Chris Cheshire <cc...@bigredwire.com>.
An InputStream is just a stream that you can read from. Don't think of
it in terms of a filesystem, that is just one small use of it. All POI
is concerned about is being able to read from the stream. It could come
from a local file, it could come from data read over a socket.
If you store the spreadsheet as a blob in the database, you can then
retrieve it via a normal sql query, and grab an inputstream from the
java blob and use it in the POI libraries.
Of course this ultimately depends on whether the database you are using
has blob functionality implemented, and their java drivers can handle it.
HTH
Chris
Halász Bálint wrote:
> Hi,
>
> I am newbie in POI.
> My primary question is :
> - Is it possible to load document(excel) from database? And if yes how?
>
> I am asking this because from the doc and API it is not quite clear the
> <http://jakarta.apache.org/poi/apidocs/org/apache/poi/poifs/filesystem/POIFSFileSystem.html#POIFSFileSystem(java.io.InputStream)> POIFSFileSystem(java.io.InputStream stream)
> can handle inputreams coming from source other than filesystem.
>
> Thanx for the help in advance,
> Balint
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org