Returning XML Data
- Last Updated: May 15, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
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