title: How to insert blob using camel SQL component with Oracle Database
body: <p>I am trying to insert an input stream using camel SQL component (<a href="http://camel.apache.org/sql-component.html" rel="nofollow">http://camel.apache.org/sql-component.html</a>).</p>
  
  <p>I have the following table in Oracle Database:</p>
  
  <pre><code>table EMPLOYEE(NAME varchar(32) ,SURNAME varchar(32)  , PIC BLOB );
  </code></pre>
  
  <p>and the following route:</p>
  
  <pre><code> &lt;route&gt;
     &lt;from uri="direct:startOracle" /&gt;
      &lt;to uri="sql:INSERT INTO EMPLOYEE (Name, surname, pics) VALUES (# , # , #)?dataSource=#oracle" /&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>when I try to run the following code:</p>
  
  <pre><code>Resource r = contex.getResource("classpath:file/ciao.jpg");
  InputStream inputStream = r.getInputStream();   
  aProducerTemplate.sendBody(new Object[] {"mario", "ross", inputStream});
  </code></pre>
  
  <p>I always get a kind incompatible third param (input stream).</p>
  
  <p>The same code runs without error on MySQL database, but on Oracle does not work well .</p>
  
  <p>I saw that component camel SQL use the following code as a strategy for the using of prepared statement:</p>
  
  <pre><code>// use argument setter as it deals with various JDBC drivers setObject vs setLong/setInteger/setString etc.
  ArgumentPreparedStatementSetter setter = new ArgumentPreparedStatementSetter(args);
  setter.setValues(ps);
  </code></pre>
  
  <p>but this strategy doesn't seem to use prepare statement as the following:</p>
  
  <pre><code>ps.setBinaryStream(3,inputStream,length);
  </code></pre>
  
  <p>but instead call the following code</p>
  
  <pre><code>ps.setObject(paramIndex, inputStream);
  </code></pre>
  
  <p>and it seem doesn't work very well on oracle db.</p>
  
  <p>So the question is: will I change the Default SQL prepared statement strategy being used by SQL camel component? Or are there other ways?</p>