 <p>if you use this code:</p> <pre><code>java.sql.Blob blob=null; blob.setBytes(1, myByte ); </code></pre> <p><code>blob</code> is null. You have to create a new Blob Object like:</p> <pre><code>Blob blob = new SerialBlob(myByte ); </code></pre> <p>and then you can store it.</p>