DB2 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 BLOB data type, the driver would return XML data as binary data:
jdbc:datadirect:db2://server1:50000;DatabaseName=jdbc;User=test;
Password=secret;XMLDescribeType=blob

© 2012 Progress Software Corporation and/or its subsidiaries or affiliates.