Thanks for joinig the thread .
Yes, I cutted some unimportant thinks, because the executing of the selection is not the problem.
As I said, that query returns the HEX-Code of that BYTE-Field . And this Hex-Code was written into that FileOutputStream Object. In final the target file has the Hex-Code of that column, so there was no Error with the SELECT - Query, but the HEX-Code isn't formated, so that I could not open the target File as an Image, but as an text-file, or something.
And when I have a look on the length of the file, it is the half number of the HEX-Chars in the File. (so it's also no plain-text in it, I guess)...
But I also think, that it could be a problem with the input, because I've loaded no Images as Files, but the HEX-Code of Images, which where lying in an other database. (Sybase)
The best think is to test this stuff with a loaded image as File ...
I will post my results later ;)
Regards, Danny
Am Fri, 6 Jun 2003 09:04:45 +0200 hat Schroeder, Alexander <[EMAIL PROTECTED]> geschrieben:
Hi Danny,
byte[] data = new byte[0]; String sqlStmt = new String("select image from voti102 where ID = 1")
I hope some code was snipped because of inserting it in the mail ...
Statement s=connection.getStatement(); rs=executeQuery("select ... ");
if( rs.next() ) data = rs.getBytes("image");
rs.close(); java.io.FileOutputStream fos = new FileOutputStream("test.jpg"); fos.write(data); fos.close();
You should also look whether your query returned something - if not you are currently writing a file of size zero. Also, maybe using SQLStudio
to select the data, and using 'export cell to file' on the result may help you diagnosing what has failed on the insert (I assume something
did get wrong here ...)
Cheers Alexander Schr�der SAP DB, SAP Labs Berlin
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
