skip to main content
DataDirect Connect Drivers : Microsoft SQL Server Driver : Returning and Inserting/Updating XML Data : Returning XML Data
  
Returning XML Data
You can specify whether XML data is returned as character or binary data by setting the XMLDescribeType property. For example, consider a database table defined as:

CREATE TABLE xmlTable (id int, xmlCol xml NOT NULL)
and the following code:

String sql="SELECT xmlCol FROM xmlTable";
ResultSet rs=stmt.executeQuery(sql);
If your application uses the following connection URL, which specifies that the XML data type be mapped to the LONGVARBINARY data type, the driver would return XML data as binary data:

jdbc:datadirect:sqlserver://server1:1433;DatabaseName=jdbc;User=test;
Password=secret;XMLDescribeType=longvarbinary