Thanks for the advice(s) Chris... 

I ignorantly hadn't realized I could open more than one stream, using only one stream 
returned a negativearray exception (?), while the second stream appears to have worked 
nicely.  

And yes, as you guessed - I hadn't closed the streams and URLConnections.  I'll 
remember in future.


regards
/j-p.



On Fri, 7 Nov 2003, Christopher Schultz wrote:

> I always try www.jguru.com -- I used to answer a lot of questions there. 
> I should go back...
> 
> Actually, I'm not entirely clear on when the stream is read. Either the 
> PreparedStatement reads the stream immediately, or it reads the stream 
> when you perform the execute(). I read the 1.4 JavaDoc and I'm still not 
> convinced either way.
> 
> Just in case it doesn't read the stream until later, simply use another 
> stream:
> 
>       URL urlImage2 = getServletContext().getResource("second image");
>       URLConnection urlImageConn2 = urlImage2.openConnection();
>       int urlImageLength2 = urlImageConn.getContentLength();
>       InputStream is2 = urlImage2.openStream();
> 
>       pStmt.setBinaryStream(x, is2, urlImageLength2);
> 
> Don't forget to close your streams and URLConnections when you're done 
> (i.e. in a finally block)!
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to