public class CachedSQLXML
extends java.lang.Object
implements java.sql.SQLXML, java.io.Serializable
| Constructor and Description |
|---|
CachedSQLXML(java.lang.String data) |
| Modifier and Type | Method and Description |
|---|---|
void |
free() |
java.io.InputStream |
getBinaryStream() |
java.io.Reader |
getCharacterStream() |
<T extends javax.xml.transform.Source> |
getSource(java.lang.Class<T> sourceClass)
Returns a
Source for reading the XML value represented by this object. |
java.lang.String |
getString() |
java.io.OutputStream |
setBinaryStream() |
java.io.Writer |
setCharacterStream() |
<T extends javax.xml.transform.Result> |
setResult(java.lang.Class<T> resultClass) |
void |
setString(java.lang.String value) |
public void free()
throws java.sql.SQLException
free in interface java.sql.SQLXMLjava.sql.SQLExceptionpublic java.io.InputStream getBinaryStream()
throws java.sql.SQLException
getBinaryStream in interface java.sql.SQLXMLjava.sql.SQLExceptionpublic java.io.OutputStream setBinaryStream()
throws java.sql.SQLException
setBinaryStream in interface java.sql.SQLXMLjava.sql.SQLExceptionpublic java.io.Reader getCharacterStream()
throws java.sql.SQLException
getCharacterStream in interface java.sql.SQLXMLjava.sql.SQLExceptionpublic java.io.Writer setCharacterStream()
throws java.sql.SQLException
setCharacterStream in interface java.sql.SQLXMLjava.sql.SQLExceptionpublic java.lang.String getString()
throws java.sql.SQLException
getString in interface java.sql.SQLXMLjava.sql.SQLExceptionpublic void setString(java.lang.String value)
throws java.sql.SQLException
setString in interface java.sql.SQLXMLjava.sql.SQLExceptionpublic <T extends javax.xml.transform.Source> T getSource(java.lang.Class<T> sourceClass)
throws java.sql.SQLException
Source for reading the XML value represented by this object.
For DOMSource, SAXSource, and StAXSource, the XML is parsed by this
method using a parser configured to disable DTDs and external entity resolution, following the
OWASP
XML External Entity Prevention Cheat Sheet.
StreamSource is disabled by default. Because a StreamSource returns the XML
unparsed and the driver cannot control how the caller subsequently parses it, requesting one
from a cached SQLXML throws SQLException. Callers that require this behavior
can opt in by setting the plugin property
cacheAllowStreamSource=true, in which case the consumer of
the returned StreamSource is responsible for configuring its own parser or transformer
securely (for example, by disabling DTDs and external entities).
getSource in interface java.sql.SQLXMLT - the type of SourcesourceClass - the class of the Source to return, or null for the default
(DOMSource)Source for reading the XML value, or null if the value has been freedjava.sql.SQLException - if the value has been freed, the XML cannot be decoded, or the requested
source class is unsupportedpublic <T extends javax.xml.transform.Result> T setResult(java.lang.Class<T> resultClass)
throws java.sql.SQLException
setResult in interface java.sql.SQLXMLjava.sql.SQLException