IBM DB2 Manual page 84

Table of Contents

Advertisement

v Use the ResultSet.getObject method to retrieve the data, and then cast it to the
The following table lists the ResultSet methods and corresponding output data
types for retrieving XML data.
Table 15. ResultSet methods and data types for retrieving XML data
Method
ResultSet.getAsciiStream
ResultSet.getBinaryStream
ResultSet.getBytes
ResultSet.getCharacterStream
ResultSet.getObject
ResultSet.getSQLXML
ResultSet.getString
The following table lists the methods that you can call to retrieve data from a
java.sql.SQLXML or a com.ibm.db2.jcc.DB2Xml object, and the corresponding
output data types and type of encoding in the XML declarations.
Table 16. SQLXML and DB2Xml methods, data types, and added encoding specifications
Method
SQLXML.getBinaryStream
SQLXML.getCharacterStream
SQLXML.getSource
SQLXML.getString
DB2Xml.getDB2AsciiStream
DB2Xml.getDB2BinaryStream
DB2Xml.getDB2Bytes
DB2Xml.getDB2CharacterStream
DB2Xml.getDB2String
DB2Xml.getDB2XmlAsciiStream
DB2Xml.getDB2XmlBinaryStream
DB2Xml.getDB2XmlBytes
DB2Xml.getDB2XmlCharacterStream
DB2Xml.getDB2XmlString
68
Application Programming Guide and Reference for Java
DB2Xml type and assign it to a DB2Xml object. Then use a DB2Xml.getDB2XXX or
DB2Xml.getDB2XmlXXX method to retrieve the data into a compatible output data
type.
DB2Xml.getDB2XmlXXX methods add XML declarations with encoding
specifications to the output data. DB2Xml.getDB2XXX methods do not add XML
declarations with encoding specifications to the output data.
This technique uses the deprecated DB2Xml objects. Use of the previously
described technique is preferable.
Output data type
InputStream
InputStream
byte[]
Reader
DB2Xml
SQLXML
String
Output data type
InputStream
Reader
Source
String
InputStream
InputStream
byte[]
Reader
String
InputStream
InputStream
byte[]
Reader
String
Type of XML internal encoding declaration added
None
None
None
None
None
None
None
None
None
US-ASCII
Specified by getDB2XmlBinaryStream targetEncoding
parameter
Specified by DB2Xml.getDB2XmlBytes targetEncoding
parameter
ISO-10646-UCS-2
ISO-10646-UCS-2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents