title: Efficient Approach: Retrieve CLOB object from oracle database
body: <p>Please suggest which is efficient way to retrieve CLOB data from Oracle 10g database where the data is XML and will both provide same complete content in case the data is in GB's,</p>
  
  <pre><code>        Clob myclob = null;
          myClob= resultSet.getClob("XML_DATA");
          InputStream inputstream = myClob.getAsciiStream();
          StringWriter writer = new StringWriter();
          IOUtils.copy(inputstream, writer);
          myXmlData = writer.toString().trim();
  </code></pre>
  
  <p>(or)</p>
  
  <pre><code>        String myXml= resultSet.getString("XML_DATA");
  </code></pre>