本文整理汇总了Java中oracle.xdb.XMLType类的典型用法代码示例。如果您正苦于以下问题:Java XMLType类的具体用法?Java XMLType怎么用?Java XMLType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XMLType类属于oracle.xdb包,在下文中一共展示了XMLType类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nullSafeGet
import oracle.xdb.XMLType; //导入依赖的package包/类
@Override
public Object nullSafeGet(final ResultSet resultSet,
final String[] names,
final SessionImplementor session,
final Object owner) throws SQLException {
XMLType xmlType = (XMLType) resultSet.getObject(names[0]);
Order document = null;
if (xmlType != null) {
try {
final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
document = unmarshaller.unmarshal(xmlType.getDocument(), Order.class).getValue();
} catch (JAXBException e) {
throw new SQLException("Could not unmarshal Order", e);
}
}
return document;
}
示例2: getDOM
import oracle.xdb.XMLType; //导入依赖的package包/类
public Node getDOM(ResultSet resultSet, String columnName) throws SQLException {
final OracleResultSet oracleResultSet = getOracleResultSet(resultSet);
// XMLType xmlType = (XMLType) oracleResultSet.getObject(columnName);
final OPAQUE opaque = oracleResultSet.getOPAQUE(columnName);
final XMLType xmlType = XMLType.createXML(opaque);
final Node doc;
if(false && xmlType.isFragment()) {
// TODO: Handle XML fragment correctly
// doc = XMLUtils.parseDocumentFragment(xmlType.getStringVal());
doc = null;
} else {
// FIXME: Xerces throws when walking the tree if we return the DOM directly!!!
// doc = xmlType.getDOM();
doc = XMLUtils.stringToDOM(xmlType.getStringVal());
}
return doc;
}
示例3: convertClobToSQLXML
import oracle.xdb.XMLType; //导入依赖的package包/类
public SQLXML convertClobToSQLXML(Clob pClob) {
//TODO make database agnostic
try {
return XMLType.createXML(mDatabaseConnection.unwrap(OracleConnection.class), (CLOB) pClob);
}
catch(SQLException e) {
throw new ExInternal("XMLType can not be created",e);
}
}
示例4: createXmlType
import oracle.xdb.XMLType; //导入依赖的package包/类
/**
* @deprecated New binding allows DOMs to be bound directly into statements, do that instead.
*/
@Deprecated
public XMLType createXmlType(DOM pDOM) throws ExInternal {
throw new UnsupportedOperationException();
// try {
// return XMLType.createXML(mDatabaseConnection.unwrap(OracleConnection.class), pDOM.outputNodeToString(" ",false, false, false, false, false, true));
// }
// catch(SQLException e) {
// throw new ExInternal("XMLType can not be created",e);
// }
}
示例5: setDOM
import oracle.xdb.XMLType; //导入依赖的package包/类
public void setDOM(PreparedStatement stmt, int index, String document) throws SQLException {
// Get an OraclePreparedStatement
final OraclePreparedStatement oracleStmt = getOraclePreparedStatement(stmt);
final XMLType xmlType = XMLType.createXML(oracleStmt.getConnection(), document);
oracleStmt.setObject(index, xmlType);
}
示例6: sqlTypes
import oracle.xdb.XMLType; //导入依赖的package包/类
@Override
public int[] sqlTypes() {
return new int[]{XMLType._SQL_TYPECODE};
}
示例7: OracleXmlDialect
import oracle.xdb.XMLType; //导入依赖的package包/类
public OracleXmlDialect() {
registerColumnType(XMLType._SQL_TYPECODE, "XMLTYPE");
}
示例8: H2OracleXmlDialect
import oracle.xdb.XMLType; //导入依赖的package包/类
public H2OracleXmlDialect() {
registerColumnType(XMLType._SQL_TYPECODE, "VARCHAR2");
}
示例9: executeTask
import oracle.xdb.XMLType; //导入依赖的package包/类
@Override
public TaskCompletionMessage executeTask() {
XMLType.cleanupCache(true);
return new TaskCompletionMessage(this, "XMLType cache cleanup successful");
}