skip to main content
Using the driver : Returning and inserting/updating XML data : Returning XML data : Returning XML data as character data
  

Try DataDirect Drivers Now
Returning XML data as character data
When XMLDescribeType=longvarchar, the driver returns XML data as character data. The result set column is described with a column type of LONGVARCHAR and the column type name is xml.
When XMLDescribeType=longvarchar, your application can use the following methods to return data stored in XML columns as character data.
*ResultSet.getString()
*ResultSet.getCharacterStream()
*ResultSet.getClob()
*CallableStatement.getString()
*CallableStatement.getClob()
The driver converts the XML data returned from the database server from the UTF-8 encoding used by the database server to the UTF-16 Java String encoding.
Your application can use the following method to return data stored in XML columns as ASCII data.
*ResultSet.getAsciiStream()
The driver converts the XML data returned from the database server from the UTF-8 encoding to the ISO-8859-1 (latin1) encoding.
Note: This conversion caused by using the getAsciiStream() method may create XML that is not well-formed because the content encoding is not the default encoding and does not contain an XML declaration specifying the content encoding. Do not use the getAsciiStream() method if your application requires well-formed XML.
If XMLDescribeType=longvarbinary, your application should not use any of the methods for returning character data described in this section. In this case, the driver applies the standard JDBC character-to-binary conversion to the data, which returns the hexadecimal representation of the character data.