org.springframework.data.jdbc.support.oracle
Class OracleXmlTypeValue

java.lang.Object
  extended by org.springframework.data.jdbc.support.oracle.OracleXmlTypeValue
All Implemented Interfaces:
SqlValue, SqlXmlValue

public class OracleXmlTypeValue
extends Object
implements SqlXmlValue

Implementation of the SqlXmlValue interface, for convenient creation of type values that are provided As an XML Document.

A usage example from a StoredProcedure:

proc.declareParameter(new SqlParameter("myXml", OracleTypes.OPAQUE, "SYS.XMLTYPE"));
 ...

 Map in = new HashMap();
 in.put("myXml", new OracleXmlTypeValue(xmlDocument);
 Map out = proc.execute(in);
 

Since:
1.0
See Also:
SqlXmlValue, SqlValue, SimpleJdbcCall, StoredProcedure

Constructor Summary
OracleXmlTypeValue(Document doc)
          Constructor that takes one parameter with the XML Document value passed in to be used.
OracleXmlTypeValue(InputStream stream)
          Constructor that takes one parameter with the XML InputStream passed in to be used.
OracleXmlTypeValue(String value)
          Constructor that takes one parameter with the XML String value passed in to be used.
 
Method Summary
 void cleanup()
          Close the XMLType
 void setValue(PreparedStatement ps, int paramIndex)
          The implementation for this specific type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleXmlTypeValue

public OracleXmlTypeValue(String value)
Constructor that takes one parameter with the XML String value passed in to be used.

Parameters:
value - the String containing the XML to use.

OracleXmlTypeValue

public OracleXmlTypeValue(InputStream stream)
Constructor that takes one parameter with the XML InputStream passed in to be used.

Parameters:
stream - the InputStream containing the XML to use.

OracleXmlTypeValue

public OracleXmlTypeValue(Document doc)
Constructor that takes one parameter with the XML Document value passed in to be used.

Parameters:
doc - the Document containing the values.
Method Detail

setValue

public void setValue(PreparedStatement ps,
                     int paramIndex)
              throws SQLException
The implementation for this specific type. This method is called internally by the Spring Framework during the out parameter processing and it's not accessed by appplication code directly.

Specified by:
setValue in interface SqlValue
Throws:
SQLException
See Also:
SqlXmlValue

cleanup

public void cleanup()
Close the XMLType

Specified by:
cleanup in interface SqlValue