code: public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException
      {
          if (this.isNull())
              statement.setNull(iParamColumn, Types.BLOB);
          else
          {
              Object data = this.getData();
              ByteArrayOutputStream ostream = new ByteArrayOutputStream();
              ObjectOutputStream p = null;
              try   {
                  p = new ObjectOutputStream(ostream);
                  p.writeObject(data);
                  p.flush();
                  ostream.close();
              } catch (IOException ex)    {
                  ex.printStackTrace();   // Never
              }
  
              byte[] rgBytes = ostream.toByteArray();
              InputStream iStream = new ByteArrayInputStream(rgBytes);
              try {
                  statement.setBinaryStream(iParamColumn, iStream, rgBytes.length);
              } catch (java.lang.ArrayIndexOutOfBoundsException ex) {
                  ex.printStackTrace();
              }
          }
      }
docs: Move the physical binary data to this SQL parameter row.
  This method uses the setBinaryStrem statement method.
  @param statement The SQL prepare statement.
  @param iType the type of SQL statement.
  @param iParamColumn The column in the prepared statement to set the data.
  @exception SQLException From SQL calls.