| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private @Nullable ByteArrayOutputStream | |
| private final BaseConnection | |
| private @Nullable String | |
| private @Nullable DOMResult | |
| private boolean | |
| private boolean | |
| private final ResourceLock | |
| private @Nullable StringWriter |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| public void | free()
Implements java. This method closes this object and releases the resources that it held. |
| public @Nullable InputStream | getBinaryStream()
Implements java. Retrieves the XML value designated by this SQLXML instance as a stream. |
| public @Nullable Reader | getCharacterStream()
Implements java. Retrieves the XML value designated by this SQLXML instance as a java.io.Reader object. |
| public <T extends Source> @Nullable T | getSource(@Nullable Class<T>
The class of the source, or null.
If the class is null, a vendor specific Source implementation will be returned.
The following classes are supported at a minimum:
sourceClass)javax.xml.transform.dom.DOMSource - returns a DOMSource javax.xml.transform.sax.SAXSource - returns a SAXSource javax.xml.transform.stax.StAXSource - returns a StAXSource javax.xml.transform.stream.StreamSource - returns a StreamSource Implements java. Returns a Source for reading the XML value designated by this SQLXML instance. |
| public @Nullable String | getString()
Implements java. Returns a string representation of the XML value designated by this SQLXML instance. |
| private PGXmlFactoryFactory | |
| private void | |
| public OutputStream | setBinaryStream()
Implements java. Retrieves a stream that can be used to write the XML value that this SQLXML instance represents. |
| public Writer | setCharacterStream()
Implements java. Retrieves a stream to be used to write the XML value that this SQLXML instance represents. |
| public <T extends Result> T | setResult(Class<T>
The class of the result, or null.
If resultClass is null, a vendor specific Result implementation will be returned.
The following classes are supported at a minimum:
resultClass)javax.xml.transform.dom.DOMResult - returns a DOMResult javax.xml.transform.sax.SAXResult - returns a SAXResult javax.xml.transform.stax.StAXResult - returns a StAXResult javax.xml.transform.stream.StreamResult - returns a StreamResult Implements java. Returns a Result for setting the XML value designated by this SQLXML instance. |
| public void | setString(String
the XML value value)Implements java. Sets the XML value designated by this SQLXML instance to the given String representation. |
| active | back to summary |
|---|---|
| private boolean active | |
| byteArrayOutputStream | back to summary |
|---|---|
| private @Nullable ByteArrayOutputStream byteArrayOutputStream | |
| conn | back to summary |
|---|---|
| private final BaseConnection conn | |
| data | back to summary |
|---|---|
| private @Nullable String data | |
| domResult | back to summary |
|---|---|
| private @Nullable DOMResult domResult | |
| freed | back to summary |
|---|---|
| private boolean freed | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| lock | back to summary |
|---|---|
| private final ResourceLock lock | |
| stringWriter | back to summary |
|---|---|
| private @Nullable StringWriter stringWriter | |
| PgSQLXML | back to summary |
|---|---|
| public PgSQLXML(BaseConnection conn) | |
| PgSQLXML | back to summary |
|---|---|
| public PgSQLXML(BaseConnection conn, @Nullable String data) | |
| PgSQLXML | back to summary |
|---|---|
| private PgSQLXML(BaseConnection conn, @Nullable String data, boolean initialized) | |
| checkFreed | back to summary |
|---|---|
| private void checkFreed() throws SQLException | |
| ensureInitialized | back to summary |
|---|---|
| private void ensureInitialized() throws SQLException | |
| free | back to summary |
|---|---|
| public void free() Implements java. Doc from java. This method closes this object and releases the resources that it held.
The SQL XML object becomes invalid and neither readable or writable
when this method is called.
After
| |
| getBinaryStream | back to summary |
|---|---|
| public @Nullable InputStream getBinaryStream() throws SQLException Implements java. Doc from java. Retrieves the XML value designated by this SQLXML instance as a stream. The bytes of the input stream are interpreted according to appendix F of the XML 1.0 specification. The behavior of this method is the same as ResultSet.getBinaryStream() when the designated column of the ResultSet has a type java.sql.Types of SQLXML. The SQL XML object becomes not readable when this method is called and may also become not writable depending on implementation.
| |
| getCharacterStream | back to summary |
|---|---|
| public @Nullable Reader getCharacterStream() throws SQLException Implements java. Doc from java. Retrieves the XML value designated by this SQLXML instance as a java.io.Reader object. The format of this stream is defined by org.xml.sax.InputSource, where the characters in the stream represent the unicode code points for XML according to section 2 and appendix B of the XML 1.0 specification. Although an encoding declaration other than unicode may be present, the encoding of the stream is unicode. The behavior of this method is the same as ResultSet.getCharacterStream() when the designated column of the ResultSet has a type java.sql.Types of SQLXML. The SQL XML object becomes not readable when this method is called and may also become not writable depending on implementation.
| |
| getSource | back to summary |
|---|---|
| public <T extends Source> @Nullable T getSource(@Nullable Class<T> sourceClass) throws SQLException Implements java. Doc from java. Returns a Source for reading the XML value designated by this SQLXML instance. Sources are used as inputs to XML parsers and XSLT transformers. Sources for XML parsers will have namespace processing on by default. The systemID of the Source is implementation dependent. The SQL XML object becomes not readable when this method is called and may also become not writable depending on implementation. Note that SAX is a callback architecture, so a returned SAXSource should then be set with a content handler that will receive the SAX events from parsing. The content handler will receive callbacks based on the contents of the XML. SAXSource saxSource = sqlxml.getSource(SAXSource.class); XMLReader xmlReader = saxSource.getXMLReader(); xmlReader.setContentHandler(myHandler); xmlReader.parse(saxSource.getInputSource());
| |
| getString | back to summary |
|---|---|
| public @Nullable String getString() throws SQLException Implements java. Doc from java. Returns a string representation of the XML value designated by this SQLXML instance. The format of this String is defined by org.xml.sax.InputSource, where the characters in the stream represent the unicode code points for XML according to section 2 and appendix B of the XML 1.0 specification. Although an encoding declaration other than unicode may be present, the encoding of the String is unicode. The behavior of this method is the same as ResultSet.getString() when the designated column of the ResultSet has a type java.sql.Types of SQLXML. The SQL XML object becomes not readable when this method is called and may also become not writable depending on implementation.
| |
| getXmlFactoryFactory | back to summary |
|---|---|
| private PGXmlFactoryFactory getXmlFactoryFactory() throws SQLException | |
| initialize | back to summary |
|---|---|
| private void initialize() throws SQLException | |
| setBinaryStream | back to summary |
|---|---|
| public OutputStream setBinaryStream() throws SQLException Implements java. Doc from java. Retrieves a stream that can be used to write the XML value that this SQLXML instance represents. The stream begins at position 0. The bytes of the stream are interpreted according to appendix F of the XML 1.0 specification The behavior of this method is the same as ResultSet.updateBinaryStream() when the designated column of the ResultSet has a type java.sql.Types of SQLXML. The SQL XML object becomes not writable when this method is called and may also become not readable depending on implementation.
| |
| setCharacterStream | back to summary |
|---|---|
| public Writer setCharacterStream() throws SQLException Implements java. Doc from java. Retrieves a stream to be used to write the XML value that this SQLXML instance represents. The format of this stream is defined by org.xml.sax.InputSource, where the characters in the stream represent the unicode code points for XML according to section 2 and appendix B of the XML 1.0 specification. Although an encoding declaration other than unicode may be present, the encoding of the stream is unicode. The behavior of this method is the same as ResultSet.updateCharacterStream() when the designated column of the ResultSet has a type java.sql.Types of SQLXML. The SQL XML object becomes not writable when this method is called and may also become not readable depending on implementation.
| |
| setResult | back to summary |
|---|---|
| public <T extends Result> T setResult(Class<T> resultClass) throws SQLException Implements java. Doc from java. Returns a Result for setting the XML value designated by this SQLXML instance. The systemID of the Result is implementation dependent. The SQL XML object becomes not writable when this method is called and may also become not readable depending on implementation. Note that SAX is a callback architecture and the returned SAXResult has a content handler assigned that will receive the SAX events based on the contents of the XML. Call the content handler with the contents of the XML document to assign the values. SAXResult saxResult = sqlxml.setResult(SAXResult.class); ContentHandler contentHandler = saxResult.getXMLReader().getContentHandler(); contentHandler.startDocument(); // set the XML elements and attributes into the result contentHandler.endDocument();
| |
| setString | back to summary |
|---|---|
| public void setString(String value) throws SQLException Implements java. Doc from java. Sets the XML value designated by this SQLXML instance to the given String representation. The format of this String is defined by org.xml.sax.InputSource, where the characters in the stream represent the unicode code points for XML according to section 2 and appendix B of the XML 1.0 specification. Although an encoding declaration other than unicode may be present, the encoding of the String is unicode. The behavior of this method is the same as ResultSet.updateString() when the designated column of the ResultSet has a type java.sql.Types of SQLXML. The SQL XML object becomes not writable when this method is called and may also become not readable depending on implementation.
| |