public interface SQLXML
The mapping in JavaTM for the SQL XML
type. SQL XML
is a built-in type that stores XML as a column value in a row of a database table. An SQLXML
object is
valid for the duration of the transaction in which it was created.The SQLXML
interface provides
methods for getting a string representation of the SQL XML
value and for generating a StAX
stream representation of the XML
value. Methods in the interfaces ResultSet
,
CallableStatement
, and PreparedStatement
, such as
getXml
and setXml
allow a programmer to access an SQL XML
value.
In addition, this interface also includes methods for updating an XML
value.
Method Summary | |
---|---|
javax.xml.stream.XMLStreamReader |
createXMLStreamReader()
Returns a reader that will produce the events corresponding to the XML returned by the data |
javax.xml.stream.XMLStreamWriter |
createXMLStreamWriter()
Returns a writer that will populate the stream with XML events. |
void |
free()
This method closes the SQLXML object and releases the resources that it held. |
String |
getString()
Retrieves a string representation of the XML value designated by this SQLXML object. |
boolean |
isEmpty()
Denotes whether the SQLXML object is empty. |
int |
setString(String str)
Writes the given Java String to the XML value that this SQLXML object designates. |
Method Detail |
---|
void free() throws SQLException
SQLXML
object and releases the resources that it held. The object
is invalid once the free
method is called. If free
is called multiple times,
the subsequent calls to free
are treated as a no-op.
SQLException
- if an error occurs in releasing the SQLXML
resourcesjavax.xml.stream.XMLStreamReader createXMLStreamReader() throws SQLException
javax.xml.stream.XMLStreamReader
object containing the XML
SQLException
- if there is an error accessing the XML valuejavax.xml.stream.XMLStreamWriter createXMLStreamWriter() throws SQLException
javax.xml.stream.XMLStreamWriter
object
SQLException
- if the receiver is not emptyString getString() throws SQLException
SQLXML
object.
SQLException
- if there is an error accessing the XML valueint setString(String str) throws SQLException
SQLXML
object designates.
str
- the string to be written to the XML value that this SQLXML
designates
SQLException
- if there is an error accessing the XML valueboolean isEmpty() throws SQLException
SQLXML
object is empty.
SQLException
- if there is an error accessing the XML value