当前位置: 首页>>代码示例>>Java>>正文


Java XMLType类代码示例

本文整理汇总了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;
}
 
开发者ID:switchbitio,项目名称:xmltype-jpa,代码行数:20,代码来源:OrderUserType.java

示例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;
    }
 
开发者ID:evlist,项目名称:orbeon-forms,代码行数:20,代码来源:SQLProcessorOracleDelegateBase.java

示例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);
  }
}
 
开发者ID:Fivium,项目名称:FOXopen,代码行数:10,代码来源:UCon.java

示例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);
//    }
  }
 
开发者ID:Fivium,项目名称:FOXopen,代码行数:14,代码来源:UCon.java

示例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);
}
 
开发者ID:evlist,项目名称:orbeon-forms,代码行数:8,代码来源:SQLProcessorOracleDelegateBase.java

示例6: sqlTypes

import oracle.xdb.XMLType; //导入依赖的package包/类
@Override
public int[] sqlTypes() {
    return new int[]{XMLType._SQL_TYPECODE};
}
 
开发者ID:switchbitio,项目名称:xmltype-jpa,代码行数:5,代码来源:OrderUserType.java

示例7: OracleXmlDialect

import oracle.xdb.XMLType; //导入依赖的package包/类
public OracleXmlDialect() {
    registerColumnType(XMLType._SQL_TYPECODE, "XMLTYPE");
}
 
开发者ID:switchbitio,项目名称:xmltype-jpa,代码行数:4,代码来源:OracleXmlDialect.java

示例8: H2OracleXmlDialect

import oracle.xdb.XMLType; //导入依赖的package包/类
public H2OracleXmlDialect() {
    registerColumnType(XMLType._SQL_TYPECODE, "VARCHAR2");
}
 
开发者ID:switchbitio,项目名称:xmltype-jpa,代码行数:4,代码来源:H2OracleXmlDialect.java

示例9: executeTask

import oracle.xdb.XMLType; //导入依赖的package包/类
@Override
public TaskCompletionMessage executeTask() {
  XMLType.cleanupCache(true);
  return new TaskCompletionMessage(this, "XMLType cache cleanup successful");
}
 
开发者ID:Fivium,项目名称:FOXopen,代码行数:6,代码来源:ConnectionAgent.java


注:本文中的oracle.xdb.XMLType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。