I am retrieving data from the MySQL server, where one column name is having the datatype as XML. I need the data inside XML attribute for some comparison. I want to store data type and values of the XML attribute in one
List<ArrayList<String>> because another side of my data to be compared in ArrayList. Suggest me using the ResultSet to access from the database, How I can store in java
Thanks in advance.
getSQLXML() method which can be used for fetching XML from the xml datatype column.
ResultSetMetaData to confirm the datatype returned by xml datatype column.
Use getString() method from SQLXML interface to get XML data in the form of string and then use JAXB for converting XML to POJO.
Alternatively, you can get the binary stream from SQLXML and use parsers such as SAX, DOM or StAX parser.