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

Try DataDirect Drivers Now

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
* Returning XML data as character data
* Returning XML data as binary data