public class

Jdbc4SqlXmlHandler

extends Object
implements SqlXmlHandler
java.lang.Object
   ↳ org.springframework.jdbc.support.xml.Jdbc4SqlXmlHandler

Class Overview

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.

See Also

Summary

Public Constructors
Jdbc4SqlXmlHandler()
Public Methods
InputStream getXmlAsBinaryStream(ResultSet rs, int columnIndex)
Retrieve the given column as binary stream from the given ResultSet.
InputStream getXmlAsBinaryStream(ResultSet rs, String columnName)
Retrieve the given column as binary stream from the given ResultSet.
Reader getXmlAsCharacterStream(ResultSet rs, String columnName)
Retrieve the given column as character stream from the given ResultSet.
Reader getXmlAsCharacterStream(ResultSet rs, int columnIndex)
Retrieve the given column as character stream from the given ResultSet.
Source getXmlAsSource(ResultSet rs, int columnIndex, Class sourceClass)
Retrieve the given column as Source implemented using the specified source class from the given ResultSet.
Source getXmlAsSource(ResultSet rs, String columnName, Class sourceClass)
Retrieve the given column as Source implemented using the specified source class from the given ResultSet.
String getXmlAsString(ResultSet rs, int columnIndex)
Retrieve the given column as String from the given ResultSet.
String getXmlAsString(ResultSet rs, String columnName)
Retrieve the given column as String from the given ResultSet.
SqlXmlValue newSqlXmlValue(XmlBinaryStreamProvider provider)
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue newSqlXmlValue(Class resultClass, XmlResultProvider 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.
SqlXmlValue newSqlXmlValue(Document document)
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
SqlXmlValue newSqlXmlValue(String value)
Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.jdbc.support.xml.SqlXmlHandler

Public Constructors

public Jdbc4SqlXmlHandler ()

Public Methods

public InputStream getXmlAsBinaryStream (ResultSet rs, int columnIndex)

Retrieve the given column as binary stream from the given ResultSet.

Might simply invoke ResultSet.getAsciiStream or work with SQLXML or database-specific classes depending on the database and driver.

Parameters
rs the ResultSet to retrieve the content from
columnIndex the column index to use
Returns
  • the content as binary stream, or null in case of SQL NULL
Throws
SQLException

public InputStream getXmlAsBinaryStream (ResultSet rs, String columnName)

Retrieve the given column as binary stream from the given ResultSet.

Might simply invoke ResultSet.getAsciiStream or work with SQLXML or database-specific classes depending on the database and driver.

Parameters
rs the ResultSet to retrieve the content from
columnName the column name to use
Returns
  • the content as a binary stream, or null in case of SQL NULL
Throws
SQLException

public Reader getXmlAsCharacterStream (ResultSet rs, String columnName)

Retrieve the given column as character stream from the given ResultSet.

Might simply invoke ResultSet.getCharacterStream or work with SQLXML or database-specific classes depending on the database and driver.

Parameters
rs the ResultSet to retrieve the content from
columnName the column name to use
Returns
  • the content as character stream
Throws
SQLException

public Reader getXmlAsCharacterStream (ResultSet rs, int columnIndex)

Retrieve the given column as character stream from the given ResultSet.

Might simply invoke ResultSet.getCharacterStream or work with SQLXML or database-specific classes depending on the database and driver.

Parameters
rs the ResultSet to retrieve the content from
columnIndex the column index to use
Returns
  • the content as character stream
Throws
SQLException

public Source getXmlAsSource (ResultSet rs, int columnIndex, Class sourceClass)

Retrieve the given column as Source implemented using the specified source class from the given ResultSet.

Might work with SQLXML or database-specific classes depending on the database and driver.

Parameters
rs the ResultSet to retrieve the content from
columnIndex the column index to use
sourceClass the implementation class to be used
Returns
  • the content as character stream
Throws
SQLException

public Source getXmlAsSource (ResultSet rs, String columnName, Class sourceClass)

Retrieve the given column as Source implemented using the specified source class from the given ResultSet.

Might work with SQLXML or database-specific classes depending on the database and driver.

Parameters
rs the ResultSet to retrieve the content from
columnName the column name to use
sourceClass the implementation class to be used
Returns
  • the content as character stream
Throws
SQLException

public String getXmlAsString (ResultSet rs, int columnIndex)

Retrieve the given column as String from the given ResultSet.

Might simply invoke ResultSet.getString or work with SQLXML or database-specific classes depending on the database and driver.

Parameters
rs the ResultSet to retrieve the content from
columnIndex the column index to use
Returns
  • the content as String, or null in case of SQL NULL
Throws
SQLException

public String getXmlAsString (ResultSet rs, String columnName)

Retrieve the given column as String from the given ResultSet.

Might simply invoke ResultSet.getString or work with SQLXML or database-specific classes depending on the database and driver.

Parameters
rs the ResultSet to retrieve the content from
columnName the column name to use
Returns
  • the content as String, or null in case of SQL NULL
Throws
SQLException

public SqlXmlValue newSqlXmlValue (XmlBinaryStreamProvider provider)

Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters
provider the XmlBinaryStreamProvider providing XML data
Returns
  • the implementation specific instance

public SqlXmlValue newSqlXmlValue (Class resultClass, XmlResultProvider provider)

Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters
resultClass the Result implementation class to be used
provider the XmlResultProvider that will provide the XML data
Returns
  • the implementation specific instance

public SqlXmlValue newSqlXmlValue (XmlCharacterStreamProvider provider)

Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters
provider the XmlCharacterStreamProvider providing XML data
Returns
  • the implementation specific instance

public SqlXmlValue newSqlXmlValue (Document document)

Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters
document the XML Document to be used
Returns
  • the implementation specific instance

public SqlXmlValue newSqlXmlValue (String value)

Create a SqlXmlValue instance for the given XML data, as supported by the underlying JDBC driver.

Parameters
value the XML String value providing XML data
Returns
  • the implementation specific instance