title: How to read/export XML file which is output from SQL server in JAVA
body: <p>I have a Query, which I execute in <strong>SQL server 2005/2008</strong>, gives me output in <code>XML</code> format.</p>
  <p>Here is the sample query to generate xml output :</p>
  <pre><code>SELECT 
      (SELECT 'White' AS Color1,
              'Blue' AS Color2,
              'Black' AS Color3,
              'Light' AS 'Color4/@Special',
              'Green' AS Color4,
              'Red' AS Color5 
      FOR XML PATH('Colors'),TYPE),
      (SELECT 'Apple' AS Fruits1,
              'Pineapple' AS Fruits2,
              'Grapes' AS Fruits3,
              'Melon' AS Fruits4 
      FOR XML PATH('Fruits'),TYPE) 
  FOR XML PATH(''),ROOT('SampleXML')
  </code></pre>
  <p>What I need is, to read the output in <strong>Java</strong> to convert it to a <code>java.io.File</code> format, so I can parse and populate objects.</p>
  <p>I tried : <code>SQLXML sqlxml = resultSet.getSQLXML(column);</code>, which is given in <a href="http://docs.oracle.com/javase/6/docs/api/java/sql/SQLXML.html" rel="nofollow noreferrer">here</a></p>
  <p>But it is throwing an exception : <code>Exception in thread &quot;main&quot; java.lang.AbstractMethodError: com.inet.pool.g.getSQLXML(I)Ljava/sql/SQLXML;</code></p>
  <p>Please suggest me a way to read the file.</p>
  <p><strong>Plz Note :</strong> I am able to read the o/p as <code>String</code> using <code>resultSet.getString(column)</code>, but not able to parse it.</p>