title: Why is creation of Clob tied to the Connection class?
body: <p>I have a Java method which passes a CLOB to a PL/SQL procedure using JDBC. I was able to do that using the <code>createClob()</code> method of the <code>Connection</code> class. </p>
  
  <p>Here is the <a href="https://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html" rel="nofollow">Java Doc for the Connection class</a>. If you notice other than <code>createClob()</code> method there are also <code>createBlob()</code> , <code>createArrayOf()</code> , <code>createNClob()</code> methods in this class.</p>
  
  <p>I am curious why the creation of instances of <code>Blob</code> ,  <code>Clob</code> , <code>NClob</code> is part of the <code>Connection</code> class ? It seems a bit out of place. Why should datatypes and its creation be tied to connection object ?</p>
  
  <p>Why can't we create instances of these datatypes independently ? I am planning to expose this method with the following signature in a SOAP Web Services:</p>
  
  <pre><code>public String handleEmployeeReview(int empId , String fileName)
  </code></pre>
  
  <p>It seems little odd that a web service client would first have to create a <code>Connection</code> instance for creating a instance of <code>Clob</code>. (Unless there is another way of creating and passing Clobs that I am unaware of.)</p>
  
  <p>Which also makes me wonder if my choice of <code>Clob</code> datatype for this method is the right one. Considering its being exposed in the web service.</p>