apache poi - Reading Excel Data Issue From DB (CLOB Column) in Java with POI -


i have question looks me hard @ first glance maybe has easy solution cant figure out yet. need read binary data of excel file stored in oracle database clob column.

everything ok reading clob string in java. excel file binaries on string parameter.

string respxls = othraw.getoperationdata(); // here excel file inputstream bais = new bytearrayinputstream(respxls.getbytes());  poifsfilesystem fs = new poifsfilesystem(bais); hssfworkbook wb = new hssfworkbook(fs); 

then try read bytestreamdata , put in poifsfilesystem exception:

java.io.ioexception: invalid header signature; read 0x00003f1a3f113f3f, expected 0xe11ab1a1e011cfd0 

i googled excel problems, mention read access. download same excel file hdd , change nothing it(even did not open it), , use fileinputstream giving file path. has worked flawless. reason?

any advice or alternative way read clob appreciated.

thanks in advance, regards.

clob means character large object; want use blob - binary large object. change database schema.

what happens clob use character set convert string to/from database internal format, whatever is; cause file corruption on non-text contents.

repeat after me: string not byte[], , character not byte.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -