stream « Blob « Java Database Q&A

2. Uplod Blob with stream

3. How do you convert an stream in to Blob data?

If your JDBC driver is fully up-to-date, you can create a blob using Connection.createBlob(). You can then use setBinaryStream(0) to retrieve an OutputStream to which you can start writing. If the JDBC driver does not allow you to create Blob instances this way, you can always use PreparedStatement and its setBinaryStream methods.