|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler
public class Jdbc4SqlXmlHandler
Default implementation of the 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)
Nested Class Summary | |
---|---|
private static class |
Jdbc4SqlXmlHandler.AbstractJdbc4SqlXmlValue
Internal base class for SqlXmlValue implementations. |
Constructor Summary | |
---|---|
Jdbc4SqlXmlHandler()
|
Method Summary | |
---|---|
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 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 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 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Jdbc4SqlXmlHandler()
Method Detail |
---|
public java.lang.String getXmlAsString(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException
SqlXmlHandler
Might simply invoke ResultSet.getString
or work with
SQLXML
or database-specific classes depending on the
database and driver.
getXmlAsString
in interface SqlXmlHandler
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to use
null
in case of SQL NULL
java.sql.SQLException
- if thrown by JDBC methodsResultSet.getString(int)
,
ResultSet.getSQLXML(int)
public java.lang.String getXmlAsString(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
SqlXmlHandler
Might simply invoke ResultSet.getString
or work with
SQLXML
or database-specific classes depending on the
database and driver.
getXmlAsString
in interface SqlXmlHandler
rs
- the ResultSet to retrieve the content fromcolumnIndex
- the column index to use
null
in case of SQL NULL
java.sql.SQLException
- if thrown by JDBC methodsResultSet.getString(int)
,
ResultSet.getSQLXML(int)
public java.io.InputStream getXmlAsBinaryStream(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException
SqlXmlHandler
Might simply invoke ResultSet.getAsciiStream
or work with
SQLXML
or database-specific classes depending on the
database and driver.
getXmlAsBinaryStream
in interface SqlXmlHandler
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to use
null
in case of SQL NULL
java.sql.SQLException
- if thrown by JDBC methodsResultSet.getSQLXML(int)
,
SQLXML.getBinaryStream()
public java.io.InputStream getXmlAsBinaryStream(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
SqlXmlHandler
Might simply invoke ResultSet.getAsciiStream
or work with
SQLXML
or database-specific classes depending on the
database and driver.
getXmlAsBinaryStream
in interface SqlXmlHandler
rs
- the ResultSet to retrieve the content fromcolumnIndex
- the column index to use
null
in case of SQL NULL
java.sql.SQLException
- if thrown by JDBC methodsResultSet.getSQLXML(int)
,
SQLXML.getBinaryStream()
public java.io.Reader getXmlAsCharacterStream(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException
SqlXmlHandler
Might simply invoke ResultSet.getCharacterStream
or work with
SQLXML
or database-specific classes depending on the
database and driver.
getXmlAsCharacterStream
in interface SqlXmlHandler
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to use
java.sql.SQLException
- if thrown by JDBC methodsResultSet.getSQLXML(int)
,
SQLXML.getCharacterStream()
public java.io.Reader getXmlAsCharacterStream(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
SqlXmlHandler
Might simply invoke ResultSet.getCharacterStream
or work with
SQLXML
or database-specific classes depending on the
database and driver.
getXmlAsCharacterStream
in interface SqlXmlHandler
rs
- the ResultSet to retrieve the content fromcolumnIndex
- the column index to use
java.sql.SQLException
- if thrown by JDBC methodsResultSet.getSQLXML(int)
,
SQLXML.getCharacterStream()
public javax.xml.transform.Source getXmlAsSource(java.sql.ResultSet rs, java.lang.String columnName, java.lang.Class sourceClass) throws java.sql.SQLException
SqlXmlHandler
Might work with SQLXML
or database-specific classes depending
on the database and driver.
getXmlAsSource
in interface SqlXmlHandler
rs
- the ResultSet to retrieve the content fromcolumnName
- the column name to usesourceClass
- the implementation class to be used
java.sql.SQLException
- if thrown by JDBC methodsResultSet.getSQLXML(int)
,
SQLXML.getSource(java.lang.Class)
public javax.xml.transform.Source getXmlAsSource(java.sql.ResultSet rs, int columnIndex, java.lang.Class sourceClass) throws java.sql.SQLException
SqlXmlHandler
Might work with SQLXML
or database-specific classes depending
on the database and driver.
getXmlAsSource
in interface SqlXmlHandler
rs
- the ResultSet to retrieve the content fromcolumnIndex
- the column index to usesourceClass
- the implementation class to be used
java.sql.SQLException
- if thrown by JDBC methodsResultSet.getSQLXML(int)
,
SQLXML.getSource(java.lang.Class)
public SqlXmlValue newSqlXmlValue(java.lang.String value)
SqlXmlHandler
SqlXmlValue
instance for the given XML data,
as supported by the underlying JDBC driver.
newSqlXmlValue
in interface SqlXmlHandler
value
- the XML String value providing XML data
SqlXmlValue
,
SQLXML.setString(String)
public SqlXmlValue newSqlXmlValue(XmlBinaryStreamProvider provider)
SqlXmlHandler
SqlXmlValue
instance for the given XML data,
as supported by the underlying JDBC driver.
newSqlXmlValue
in interface SqlXmlHandler
provider
- the XmlBinaryStreamProvider
providing XML data
SqlXmlValue
,
SQLXML.setBinaryStream()
public SqlXmlValue newSqlXmlValue(XmlCharacterStreamProvider provider)
SqlXmlHandler
SqlXmlValue
instance for the given XML data,
as supported by the underlying JDBC driver.
newSqlXmlValue
in interface SqlXmlHandler
provider
- the XmlCharacterStreamProvider
providing XML data
SqlXmlValue
,
SQLXML.setCharacterStream()
public SqlXmlValue newSqlXmlValue(java.lang.Class resultClass, XmlResultProvider provider)
SqlXmlHandler
SqlXmlValue
instance for the given XML data,
as supported by the underlying JDBC driver.
newSqlXmlValue
in interface SqlXmlHandler
resultClass
- the Result implementation class to be usedprovider
- the XmlResultProvider
that will provide the XML data
SqlXmlValue
,
SQLXML.setResult(Class)
public SqlXmlValue newSqlXmlValue(org.w3c.dom.Document document)
SqlXmlHandler
SqlXmlValue
instance for the given XML data,
as supported by the underlying JDBC driver.
newSqlXmlValue
in interface SqlXmlHandler
document
- the XML Document to be used
SqlXmlValue
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |