public class Jdbc4SqlXmlHandler extends java.lang.Object implements SqlXmlHandler
SqlXmlHandler interface.
Provides database-specific implementations for storing and
retrieving XML documents to and from fields in a database,
relying on the JDBC 4.0 java.sql.SQLXML facility.SQLXML,
ResultSet.getSQLXML(int),
PreparedStatement.setSQLXML(int, java.sql.SQLXML)| Constructor and Description |
|---|
Jdbc4SqlXmlHandler() |
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getXmlAsBinaryStream(java.sql.ResultSet rs,
int columnIndex)
Retrieve the given column as binary stream from the given ResultSet.
|
java.io.InputStream |
getXmlAsBinaryStream(java.sql.ResultSet rs,
java.lang.String columnName)
Retrieve the given column as binary stream from the given ResultSet.
|
java.io.Reader |
getXmlAsCharacterStream(java.sql.ResultSet rs,
int columnIndex)
Retrieve the given column as character stream from the given ResultSet.
|
java.io.Reader |
getXmlAsCharacterStream(java.sql.ResultSet rs,
java.lang.String columnName)
Retrieve the given column as character stream from the given ResultSet.
|
javax.xml.transform.Source |
getXmlAsSource(java.sql.ResultSet rs,
int columnIndex,
java.lang.Class<? extends javax.xml.transform.Source> sourceClass)
Retrieve the given column as Source implemented using the specified source class
from the given ResultSet.
|
javax.xml.transform.Source |
getXmlAsSource(java.sql.ResultSet rs,
java.lang.String columnName,
java.lang.Class<? extends javax.xml.transform.Source> sourceClass)
Retrieve the given column as Source implemented using the specified source class
from the given ResultSet.
|
java.lang.String |
getXmlAsString(java.sql.ResultSet rs,
int columnIndex)
Retrieve the given column as String from the given ResultSet.
|
java.lang.String |
getXmlAsString(java.sql.ResultSet rs,
java.lang.String columnName)
Retrieve the given column as String from the given ResultSet.
|
SqlXmlValue |
newSqlXmlValue(java.lang.Class<? extends javax.xml.transform.Result> resultClass,
XmlResultProvider provider)
Create a
SqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver. |
SqlXmlValue |
newSqlXmlValue(org.w3c.dom.Document document)
Create a
SqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver. |
SqlXmlValue |
newSqlXmlValue(java.lang.String value)
Create a
SqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver. |
SqlXmlValue |
newSqlXmlValue(XmlBinaryStreamProvider provider)
Create a
SqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver. |
SqlXmlValue |
newSqlXmlValue(XmlCharacterStreamProvider provider)
Create a
SqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver. |
@Nullable public java.lang.String getXmlAsString(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException
SqlXmlHandlerMight simply invoke ResultSet.getString or work with
SQLXML or database-specific classes depending on the
database and driver.
getXmlAsString in interface SqlXmlHandlerrs - the ResultSet to retrieve the content fromcolumnName - the column name to usenull in case of SQL NULLjava.sql.SQLException - if thrown by JDBC methodsResultSet.getString(int),
ResultSet.getSQLXML(int)@Nullable public java.lang.String getXmlAsString(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
SqlXmlHandlerMight simply invoke ResultSet.getString or work with
SQLXML or database-specific classes depending on the
database and driver.
getXmlAsString in interface SqlXmlHandlerrs - the ResultSet to retrieve the content fromcolumnIndex - the column index to usenull in case of SQL NULLjava.sql.SQLException - if thrown by JDBC methodsResultSet.getString(int),
ResultSet.getSQLXML(int)@Nullable public java.io.InputStream getXmlAsBinaryStream(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException
SqlXmlHandlerMight simply invoke ResultSet.getAsciiStream or work with
SQLXML or database-specific classes depending on the
database and driver.
getXmlAsBinaryStream in interface SqlXmlHandlerrs - the ResultSet to retrieve the content fromcolumnName - the column name to usenull in case of SQL NULLjava.sql.SQLException - if thrown by JDBC methodsResultSet.getSQLXML(int),
SQLXML.getBinaryStream()@Nullable public java.io.InputStream getXmlAsBinaryStream(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
SqlXmlHandlerMight simply invoke ResultSet.getAsciiStream or work with
SQLXML or database-specific classes depending on the
database and driver.
getXmlAsBinaryStream in interface SqlXmlHandlerrs - the ResultSet to retrieve the content fromcolumnIndex - the column index to usenull in case of SQL NULLjava.sql.SQLException - if thrown by JDBC methodsResultSet.getSQLXML(int),
SQLXML.getBinaryStream()@Nullable public java.io.Reader getXmlAsCharacterStream(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException
SqlXmlHandlerMight simply invoke ResultSet.getCharacterStream or work with
SQLXML or database-specific classes depending on the
database and driver.
getXmlAsCharacterStream in interface SqlXmlHandlerrs - the ResultSet to retrieve the content fromcolumnName - the column name to usenull in case of SQL NULLjava.sql.SQLException - if thrown by JDBC methodsResultSet.getSQLXML(int),
SQLXML.getCharacterStream()@Nullable public java.io.Reader getXmlAsCharacterStream(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
SqlXmlHandlerMight simply invoke ResultSet.getCharacterStream or work with
SQLXML or database-specific classes depending on the
database and driver.
getXmlAsCharacterStream in interface SqlXmlHandlerrs - the ResultSet to retrieve the content fromcolumnIndex - the column index to usenull in case of SQL NULLjava.sql.SQLException - if thrown by JDBC methodsResultSet.getSQLXML(int),
SQLXML.getCharacterStream()@Nullable public javax.xml.transform.Source getXmlAsSource(java.sql.ResultSet rs, java.lang.String columnName, @Nullable java.lang.Class<? extends javax.xml.transform.Source> sourceClass) throws java.sql.SQLException
SqlXmlHandlerMight work with SQLXML or database-specific classes depending
on the database and driver.
getXmlAsSource in interface SqlXmlHandlerrs - the ResultSet to retrieve the content fromcolumnName - the column name to usesourceClass - the implementation class to be usednull in case of SQL NULLjava.sql.SQLException - if thrown by JDBC methodsResultSet.getSQLXML(int),
SQLXML.getSource(java.lang.Class<T>)@Nullable public javax.xml.transform.Source getXmlAsSource(java.sql.ResultSet rs, int columnIndex, @Nullable java.lang.Class<? extends javax.xml.transform.Source> sourceClass) throws java.sql.SQLException
SqlXmlHandlerMight work with SQLXML or database-specific classes depending
on the database and driver.
getXmlAsSource in interface SqlXmlHandlerrs - the ResultSet to retrieve the content fromcolumnIndex - the column index to usesourceClass - the implementation class to be usednull in case of SQL NULLjava.sql.SQLException - if thrown by JDBC methodsResultSet.getSQLXML(int),
SQLXML.getSource(java.lang.Class<T>)public SqlXmlValue newSqlXmlValue(java.lang.String value)
SqlXmlHandlerSqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver.newSqlXmlValue in interface SqlXmlHandlervalue - the XML String value providing XML dataSqlXmlValue,
SQLXML.setString(String)public SqlXmlValue newSqlXmlValue(XmlBinaryStreamProvider provider)
SqlXmlHandlerSqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver.newSqlXmlValue in interface SqlXmlHandlerprovider - the XmlBinaryStreamProvider providing XML dataSqlXmlValue,
SQLXML.setBinaryStream()public SqlXmlValue newSqlXmlValue(XmlCharacterStreamProvider provider)
SqlXmlHandlerSqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver.newSqlXmlValue in interface SqlXmlHandlerprovider - the XmlCharacterStreamProvider providing XML dataSqlXmlValue,
SQLXML.setCharacterStream()public SqlXmlValue newSqlXmlValue(java.lang.Class<? extends javax.xml.transform.Result> resultClass, XmlResultProvider provider)
SqlXmlHandlerSqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver.newSqlXmlValue in interface SqlXmlHandlerresultClass - the Result implementation class to be usedprovider - the XmlResultProvider that will provide the XML dataSqlXmlValue,
SQLXML.setResult(Class)public SqlXmlValue newSqlXmlValue(org.w3c.dom.Document document)
SqlXmlHandlerSqlXmlValue instance for the given XML data,
as supported by the underlying JDBC driver.newSqlXmlValue in interface SqlXmlHandlerdocument - the XML Document to be usedSqlXmlValue