Serializable
, SQLXML
AS400JDBCSQLXMLLocator
public class AS400JDBCSQLXML extends Object implements SQLXML, Serializable
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
isXML_ |
Modifier | Constructor | Description |
---|---|---|
protected |
AS400JDBCSQLXML() |
Constructs an AS400JDBCSQLXML object.
|
Modifier and Type | Method | Description |
---|---|---|
void |
free() |
This method frees the object and releases the
the resources that it holds.
|
InputStream |
getBinaryStream() |
Retrieves the XML value designated by this SQLXML instance as a stream.
|
Reader |
getCharacterStream() |
Retrieves the XML value designated by this SQLXML instance as a java.io.Reader object.
|
<T extends Source> |
getSource(Class<T> sourceClass) |
Returns a Source for reading the XML value designated by this SQLXML instance.
|
String |
getString() |
Retrieves a string representation of the XML value designated by this
SQLXML object. |
OutputStream |
setBinaryStream() |
Retrieves a stream that can be used to write the XML value that this SQLXML instance represents.
|
Writer |
setCharacterStream() |
Retrieves a Writer to be used to write the XML value that this SQLXML instance represents.
|
<T extends Result> |
setResult(Class<T> resultClass) |
Returns a Result for setting the XML value designated by this SQLXML instance.
|
void |
setString(String str) |
Writes the given Java String to the XML value that this
SQLXML object designates. |
protected AS400JDBCSQLXML()
public Reader getCharacterStream() throws SQLException
The SQL XML object becomes not readable when this method is called and may also become not writable depending on implementation.
getCharacterStream
in interface SQLXML
SQLException
- if there is an error processing the XML value.
The getCause() method of the exception may provide a more detailed exception, for example,
if the stream does not contain valid characters.
An exception is thrown if the state is not readable.public String getString() throws SQLException
SQLXML
object.getString
in interface SQLXML
SQLException
- if there is an error accessing the XML valuepublic void setString(String str) throws SQLException
SQLXML
object designates.setString
in interface SQLXML
str
- the string to be written to the XML value that this SQLXML
designatesSQLException
- if there is an error accessing the XML valuepublic InputStream getBinaryStream() throws SQLException
getBinaryStream
in interface SQLXML
SQLException
- if there is an error processing the XML value.
An exception is thrown if the state is not readable.public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException
getSource
in interface SQLXML
sourceClass
- 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:
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
SQLException
- if there is an error processing the XML value
or if this feature is not supported.
The getCause() method of the exception may provide a more detailed exception, for example,
if an XML parser exception occurs.
An exception is thrown if the state is not readable.public OutputStream setBinaryStream() throws SQLException
setBinaryStream
in interface SQLXML
SQLException
- if there is an error processing the XML value. An exception
is thrown if the state is not writable.public Writer setCharacterStream() throws SQLException
setCharacterStream
in interface SQLXML
SQLException
- if there is an error processing the XML value.
The getCause() method of the exception may provide a more detailed exception, for example,
if the stream does not contain valid characters.
An exception is thrown if the state is not writable.public <T extends Result> T setResult(Class<T> resultClass) throws SQLException
setResult
in interface SQLXML
resultClass
- 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:
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
SQLException
- if there is an error processing the XML value
or if this feature is not supported.
The getCause() method of the exception may provide a more detailed exception, for example,
if an XML parser exception occurs.
An exception is thrown if the state is not writable.public void free() throws SQLException
free
method is called. If free
is called
multiple times, the subsequent calls to free
are treated
as a no-op.free
in interface SQLXML
SQLException
- If a database error occurs.
if an error occurs releasing the Clob's resourcesCopyright © 2024. All rights reserved.