JDBC metadata type (java.sql.Types)None
The
metadata type for XML values is SQLXML. However, the SQLXML type is not supported
by .
To retrieve
XML values from a database
using JDBC, use the XMLSERIALIZE operator in the SQL query. For example:SELECT XMLSERIALIZE (xcol as CLOB) FROM myXmlTable Then retrieve the XML value by using the getXXX method that corresponds to
the target serialization type, in this example CLOB data types.
To store
an XML value into a database
using JDBC, use the XMLPARSE operator in the SQL statement. For example: INSERT INTO myXmlTable(xcol) VALUES XMLPARSE(
DOCUMENT CAST (? AS CLOB) PRESERVE WHITESPACE)
Then use any of the setXXX methods that are compatible with String
types, in this example use the PreparedStatement.setString or PreparedStatement.setCharacterStream
method calls to bind the operator.