Hello,
yes you must always set the length parameter for the stream writing methods. The driver
stops reading the stream if the number of bytes is reached, which was specified by the
length parameter. This behavior was implemented in newer jdbc drivers because of standard
conformance. But there is a
backdoor, if you set the length parameter to -1 the driver reads from the stream until
"end of stream" was found. But be aware some streams never send an "end of stream" which
leads to an infinite loop.
Regards,
Marco Paskamp
> -----Original Message-----
> From: Raimund Jacob [mailto:raimi@stripped]
> Sent: Sonntag, 18. August 2002 20:48
> To: SAPDB mailing list
> Subject: JDBC: LONG BYTE stream writing
>
>
> hello again!
>
> i just (scaredly) realized that all JDBC stream writing methods (in
> PreparedStatement) require a "length" parameter indicating
> the length of
> the stream to be written.
>
> i was hoping that SAP DB would not require that parameter and
> had a look
> at the JDBC driver sources. In StreamTranslator.java i found out that
> only setBlob() works; setXXXStream throws an exception.
> questions: did i
> read the sources correctly ? do i always have to supply the length
> parameter ?
>
> (insert stupid-question-appology here)
> Raimund
>
> --
> Raimund Jacob
> \|/ ____ \|/
> Pinuts Media+Science GmbH "@'/ ,. \`@"
> Potsdamer Str. 96 /_| \__/ |_\
> D-10785 Berlin \__U_/
> http://www.pinuts.de/ voice: +49 30 590090322 fax: +49 30 590090390
>
> _______________________________________________
> sapdb.general mailing list
> sapdb.general@stripped
> http://listserv.sap.com/mailman/listinfo/sapdb.general
>