|
Oracle® Database XML Java API Reference 11g Release 2 (11.2) E10769-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.sql.Datum
oracle.sql.DatumWithConnection
oracle.sql.OPAQUE
oracle.xdb.XMLType
public class XMLType
Class that deals with XMLType objects.
Field Summary | |
---|---|
static int |
_SQL_TYPECODE A constant set to OPAQUE oracle type. |
static int |
CONNTYPE_KPRB KPRB connection type. |
static int |
CONNTYPE_OCI8 OCI8 connection type. |
static int |
CONNTYPE_THIN Thin connection type. |
static int |
DEF_INDENT Default indentation and print flags |
static int |
MAX_INDENT |
static int |
MAX_PFLAG |
static int |
PRINT_DEFAULT_PROPERTY |
static int |
PRINT_NOPRETTY |
static int |
PRINT_PRETTY |
static int |
XMLTYPE_PICKLE_AS_BINXML |
static int |
XMLTYPE_PICKLE_AS_TEXT Flags to specify pickle preference, used in setPicklePreference |
Fields inherited from class oracle.sql.OPAQUE |
---|
BUILD_DATE, PRIVATE_TRACE, TRACE |
Constructor Summary | |
---|---|
XMLType(java.sql.Connection conn, oracle.sql.BLOB xmlval, int csid) Construct an XMLType given a BLOB containing the XML data |
|
XMLType(java.sql.Connection conn, oracle.sql.CLOB xmlval) Construct an XMLType given a CLOB containing the XML data |
|
XMLType(java.sql.Connection conn, oracle.sql.CLOB xmlval, java.lang.String schemaURL, boolean wellformed, boolean valid) Construct an XMLType given a CLOB containing the XML data |
|
XMLType(java.sql.Connection conn, Document domdoc) Constructor to create an XMLType given an instance of the DOM document |
|
XMLType(java.sql.Connection conn, java.io.InputStream is) Construct an XMLType given a InputStream containing the XML data. |
|
XMLType(java.sql.Connection conn, long cstate) Public constructor - given the value create an XMLType |
|
XMLType(java.sql.Connection conn, Node node) |
|
XMLType(java.sql.Connection conn, java.lang.String xmlval) Construct an XMLType given the string containing the XML data |
|
XMLType(java.sql.Connection conn, java.lang.String xmlval, java.lang.String schemaURL, boolean wellformed, boolean valid) Construct an XMLType given the string containing the XML data |
|
XMLType(oracle.sql.OpaqueDescriptor type, java.sql.Connection conn, java.lang.Object value) Create an XMLType given an opaque descriptor, connection and a pickled image. |
Method Summary | |
---|---|
static void |
cleanupCache(boolean forcemode) Clean-up method for an internal cache used for Binary XML decoding. |
void |
close() Function to free/close the XMLType. |
XMLType |
createSchemaBasedXML(java.lang.String schemaURL) Create a schema-based XML |
static XMLType |
createXML(java.sql.Connection conn, oracle.sql.CLOB xmlval) Create an XMLType given a CLOB containing the XML data |
static XMLType |
createXML(java.sql.Connection conn, oracle.sql.CLOB xmlval, java.lang.String schemaURL, boolean wellformed, boolean valid) Create an XMLType given a CLOB containing the XML data |
static XMLType |
createXML(java.sql.Connection conn, Document domdoc) Create an XMLType given an instance of the DOM document |
static XMLType |
createXML(java.sql.Connection conn, java.io.InputStream is) Create an XMLType given a InputStream containing the XML data. |
static XMLType |
createXML(java.sql.Connection conn, java.lang.String xmlval) Create an XMLType given the string containing the XML data |
static XMLType |
createXML(java.sql.Connection conn, java.lang.String xmlval, java.lang.String schemaURL, boolean wellformed, boolean valid) Create an XMLType given the string containing the XML data |
static XMLType |
createXML(oracle.sql.OPAQUE opq) Create an XMLType given the opaque type containing the XMLType bytes |
boolean |
existsNode(java.lang.String xpath, java.lang.String nsmap) Function to check for the existence of the given set of nodes in the XMLType. |
XMLType |
extract(java.lang.String xpath, java.lang.String nsmap) Function to extract the given set of nodes from the XMLType. |
protected void |
freeXMLType() |
oracle.sql.BLOB |
getBlobVal(int csid) Get the BLOB value containing the XML data from the XMLType. |
oracle.sql.BLOB |
getBlobVal(int csid, int pflag, int indent) Get the BLOB value containing the XML data from the XMLType. |
oracle.sql.CLOB |
getClobVal() Get the CLOB value containing the XML data from the XMLType. |
oracle.sql.CLOB |
getClobVal(int pflag, int indent) Get the CLOB value containing the XML data from the XMLType. |
static int |
getConnType(java.sql.Connection conn) Get the connection type of the given connection. |
Document |
getDocument() Gets the DOM document associated with the XMLType. |
XDBDocFragment |
getDocumentFragment() Function to return XDBDocFragment if XMLType instance is a fragment |
Document |
getDOM() Deprecated. use getDocument |
static long |
getErrorHandle(java.sql.Connection conn, int conntype) Get the error handle given the connection and the connection type. |
java.io.InputStream |
getInputStream() Get an InputStream from the XMLType, applications can read XML data from the stream |
java.io.InputStream |
getInputStream(int pflag, int indent) Get an InputStream from the XMLType, applications can read XML data from the stream |
java.lang.String |
getNamespace() return the default namespace of the XMLType document |
oracle.sql.NUMBER |
getNumberVal() Return the numeric value of the XML document |
java.lang.String |
getRootElement() Return the root element name |
java.lang.String |
getSchemaURL() Return the schema URL (i.e. location of the schema to which this XMLType conforms) |
static long |
getServiceHandle(java.sql.Connection conn, int conntype) Get the service handle given the connection and the connection type. |
java.lang.String |
getStringVal() Get the string value containing the XML data from the XMLType. |
java.lang.String |
getStringVal(int pflag, int indent) Get the string value containing the XML data from the XMLType. |
boolean |
isFragment() Function to check if the XMLType is a regular document or a document fragment. |
boolean |
isSchemaBased() Function to check if the XMLType is schema based. |
boolean |
isSchemaValid(java.lang.String schurl, java.lang.String elname) Function to check if the XMLType is schema based. |
boolean |
isSchemaValidated() Return TRUE if the document has been validated against its schema |
void |
schemaValidate() Validate the schema-based document against its own schema. |
void |
setBinaryXML() Function to mark the XML type as Binary XML |
void |
setBinaryXMLEncoding(java.lang.String encoding) Sets the client requested encoding for retrieving Binary XML. |
void |
setMetadataConn(java.lang.Object metaconn) Function to set the metadata connection to be used for getting Binary XML token data |
void |
setPicklePreference(int pref) Function to set how the XMLType will be sent across the wire. |
void |
setSchemaValidated(boolean validateFlag) This function sets the VALIDATED flag to indicate that the XMLType has been validated or not. |
XMLType |
transform(XMLType xsldoc, java.lang.String parammap) Function to transform the XMLType using the given XSL document. |
void |
writeToOutputStream(java.io.OutputStream os) Write the contents of the XMLType to an OutputStream |
void |
writeToOutputStream(java.io.OutputStream os, int pflag, int indent) Write the contents of the XMLType to an OutputStream |
Methods inherited from class oracle.sql.OPAQUE |
---|
getBytesValue, getDescriptor, getImageLength, getImageOffset, getJavaSqlConnection, getMap, getSQLTypeName, getValue, isConvertibleTo, makeJdbcArray, setDescriptor, setImage, setImageLength, setValue, toBytes, toClass, toClass, toJdbc, toJdbc |
Methods inherited from class oracle.sql.DatumWithConnection |
---|
assertNotNull, assertNotNull, getConnection, getConnectionDuringExceptionHandling, getInternalConnection, getOracleConnection, setPhysicalConnectionOf |
Methods inherited from class oracle.sql.Datum |
---|
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, byteValue, characterStreamValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, longValue, setBytes, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.sql.ORAData |
---|
toDatum |
Field Detail |
---|
public static final int _SQL_TYPECODE
public static final int CONNTYPE_THIN
public static final int CONNTYPE_OCI8
public static final int CONNTYPE_KPRB
public static final int DEF_INDENT
public static final int MAX_INDENT
public static final int MAX_PFLAG
public static final int PRINT_DEFAULT_PROPERTY
public static final int PRINT_PRETTY
public static final int PRINT_NOPRETTY
public static final int XMLTYPE_PICKLE_AS_TEXT
public static final int XMLTYPE_PICKLE_AS_BINXML
Constructor Detail |
---|
public XMLType(java.sql.Connection conn, java.lang.String xmlval) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the string containing the XML datajava.sql.SQLException
public XMLType(java.sql.Connection conn, java.lang.String xmlval, java.lang.String schemaURL, boolean wellformed, boolean valid) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the string containing the XML dataschemaURL
- the schema URL for the XMLTypewellformed
- XML document is well-formedvalid
- XML document is validjava.sql.SQLException
public XMLType(java.sql.Connection conn, oracle.sql.CLOB xmlval) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the CLOB containing the XML datajava.sql.SQLException
public XMLType(java.sql.Connection conn, oracle.sql.CLOB xmlval, java.lang.String schemaURL, boolean wellformed, boolean valid) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the CLOB containing the XML dataschemaURL
- the schema URL for the XMLTypewellformed
- XML document is well-formedvalid
- XML document is validjava.sql.SQLException
public XMLType(java.sql.Connection conn, oracle.sql.BLOB xmlval, int csid) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the BLOB containing the XML datacsid
- the charset id.java.sql.SQLException
public XMLType(java.sql.Connection conn, java.io.InputStream is) throws java.sql.SQLException
conn
- the connection object to be used.is
- the InputStream containing the XML data.java.sql.SQLException
public XMLType(oracle.sql.OpaqueDescriptor type, java.sql.Connection conn, java.lang.Object value) throws java.sql.SQLException
type
- the opaque type descriptor to be used.conn
- the connection object to be used.value
- the pickled image bytes.java.sql.SQLException
public XMLType(java.sql.Connection conn, Document domdoc) throws java.sql.SQLException
domdoc
- the DOM Document which represents the DOM treeconn
- the connection object to be used.java.sql.SQLException
public XMLType(java.sql.Connection conn, Node node) throws java.sql.SQLException
java.sql.SQLException
public XMLType(java.sql.Connection conn, long cstate) throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public void setPicklePreference(int pref)
pref
- XMLTYPE_PICKLE_AS_TEXT or XMLTYPE_PICKLE_AS_BINXMLpublic void setMetadataConn(java.lang.Object metaconn)
metaconn
- Metadata connection of type Connectionpublic void setBinaryXML() throws java.sql.SQLException
java.sql.SQLException
public static XMLType createXML(oracle.sql.OPAQUE opq) throws java.sql.SQLException
opq
- the opaque data object from which the XMLType is to be generatedjava.sql.SQLException
public static XMLType createXML(java.sql.Connection conn, java.lang.String xmlval) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the string containing the XML datajava.sql.SQLException
public static XMLType createXML(java.sql.Connection conn, java.lang.String xmlval, java.lang.String schemaURL, boolean wellformed, boolean valid) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the string containing the XML dataschemaURL
- the schema URL for the XMLTypewellformed
- XML document is well-formedvalid
- XML document is validjava.sql.SQLException
public static XMLType createXML(java.sql.Connection conn, oracle.sql.CLOB xmlval) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the CLOB containing the XML datajava.sql.SQLException
public static XMLType createXML(java.sql.Connection conn, oracle.sql.CLOB xmlval, java.lang.String schemaURL, boolean wellformed, boolean valid) throws java.sql.SQLException
conn
- the connection object to be used.xmlval
- the CLOB containing the XML dataschemaURL
- the schema URL for the XMLTypewellformed
- XML document is well-formedvalid
- XML document is validjava.sql.SQLException
public static XMLType createXML(java.sql.Connection conn, java.io.InputStream is) throws java.sql.SQLException
conn
- the connection object to be used.is
- the InputStream containing the XML datajava.sql.SQLException
public java.lang.String getStringVal() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getStringVal(int pflag, int indent) throws java.sql.SQLException
pflag
- flags to control printindent
- indent output by "indent" charactersjava.sql.SQLException
public oracle.sql.CLOB getClobVal() throws java.sql.SQLException
java.sql.SQLException
public oracle.sql.CLOB getClobVal(int pflag, int indent) throws java.sql.SQLException
pflag
- flags to control printindent
- indent output by "indent" charactersjava.sql.SQLException
public oracle.sql.BLOB getBlobVal(int csid) throws java.sql.SQLException
csid
- The character set ID.java.sql.SQLException
public oracle.sql.BLOB getBlobVal(int csid, int pflag, int indent) throws java.sql.SQLException
csid
- The character set ID.pflag
- flags to control printindent
- indent output by "indent" charactersjava.sql.SQLException
public java.io.InputStream getInputStream() throws java.sql.SQLException
java.sql.SQLException
public java.io.InputStream getInputStream(int pflag, int indent) throws java.sql.SQLException
pflag
- flags to control printindent
- indent output by "indent" charactersjava.sql.SQLException
public void writeToOutputStream(java.io.OutputStream os) throws java.sql.SQLException
os
- The OutputStream to which the contents are written.java.sql.SQLException
public void writeToOutputStream(java.io.OutputStream os, int pflag, int indent) throws java.sql.SQLException
os
- The OutputStream to which the contents are written.pflag
- flags to control printindent
- indent output by "indent" charactersjava.sql.SQLException
public static XMLType createXML(java.sql.Connection conn, Document domdoc) throws java.sql.SQLException
domdoc
- the DOM Document which represents the DOM treeconn
- the JDBC Connectionjava.sql.SQLException
public XMLType extract(java.lang.String xpath, java.lang.String nsmap) throws java.sql.SQLException
xpath
- the xpath expression which specifies the nodes to search for.nsmap
- the map of namespaces which resolves the prefixes in the xpath expression. format is "xmlns=a.com xmlns:b=b.com"java.sql.SQLException
public boolean existsNode(java.lang.String xpath, java.lang.String nsmap) throws java.sql.SQLException
xpath
- the xpath expression which specifies the nodes to search for.nsmap
- the map of namespaces which resolves the prefixes in the xpath expression. format is "xmlns=a.com xmlns:b=b.com"java.sql.SQLException
public XMLType transform(XMLType xsldoc, java.lang.String parammap) throws java.sql.SQLException
xsldoc
- the XSL document to be applied to the XMLTypeparammap
- the top level parameters to be passed to the XSL transformation. This should be of the format "a=b c=d e=f". This can be null.java.sql.SQLException
public boolean isFragment() throws java.sql.SQLException
java.sql.SQLException
public XDBDocFragment getDocumentFragment() throws java.sql.SQLException
java.sql.SQLException
public boolean isSchemaValid(java.lang.String schurl, java.lang.String elname) throws java.sql.SQLException
schurl
- the URL of the schema to be validated against; if this is null then the documents own schema URL is used (if one exists).elname
- the name of the root element of the schemajava.sql.SQLException
public XMLType createSchemaBasedXML(java.lang.String schemaURL) throws java.sql.SQLException
schemaURL
- The schema URLjava.sql.SQLException
public java.lang.String getRootElement() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getSchemaURL() throws java.sql.SQLException
java.sql.SQLException
public boolean isSchemaBased() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getNamespace() throws java.sql.SQLException
java.sql.SQLException
public void schemaValidate() throws java.sql.SQLException
java.sql.SQLException
public boolean isSchemaValidated() throws java.sql.SQLException
java.sql.SQLException
public void setSchemaValidated(boolean validateFlag) throws java.sql.SQLException
validateFlag
- True indicates that the XMLType has been validated. False indicates that the XMLType has not been validated.java.sql.SQLException
public oracle.sql.NUMBER getNumberVal() throws java.sql.SQLException
java.sql.SQLException
public Document getDOM() throws java.sql.SQLException
java.sql.SQLException
Document
public Document getDocument() throws java.sql.SQLException
java.sql.SQLException
Document
public static long getErrorHandle(java.sql.Connection conn, int conntype) throws java.sql.SQLException
conn
- The connectionconntype
- The connection type.java.sql.SQLException
public static long getServiceHandle(java.sql.Connection conn, int conntype) throws java.sql.SQLException
conn
- The connectionconntype
- The connection type.java.sql.SQLException
protected void freeXMLType()
public void close()
public static int getConnType(java.sql.Connection conn) throws java.sql.SQLException
conn
- The connection.java.sql.SQLException
public void setBinaryXMLEncoding(java.lang.String encoding)
encoding
- The encoding.public static void cleanupCache(boolean forcemode)
forcemode
- If true, purges the entire cache; otherwise only mappings with values already garbage collected are removed from the cache.
|
Oracle® Database XML Java API Reference 11g Release 2 (11.2) E10769-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |