Tibco SQL 直接查询:JDBC 报告错误:(SQLState = ) - “这不是有效的 SQL 类型:2009

Tibco SQL Direct Query: JDBC error reported: (SQLState = ) - "This is not a valid SQL type: 2009

我正在使用 Tibco BW 5.14 和 Oracle 19c 我有具有 XMLType 列的 Oracle table。我使用本机 oracle jdbc 驱动程序 12.1.0.2.0 进行数据库连接。

当我运行查询

Select XMLTYPE_column from table 

as SQL直接activity得到错误

<?xml version = "1.0" encoding = "UTF-8"?>
<ns0:ErrorReport xmlns:ns0 = "http://www.tibco.com/pe/EngineTypes">
    <StackTrace>Job-7000 Error in [Processes/metrics_PROD.process/SQL Direct]
"JDBC error reported: (SQLState = ) - "This is not a valid SQL type: 2009""
    at com.tibco.plugin.jdbc.JDBCActivity.eval(Unknown Source)
    at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    at com.tibco.pe.core.Job.a(Unknown Source)
    at com.tibco.pe.core.Job.k(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
caused by: "This is not a valid SQL type: 2009"
    at com.tibco.plugin.jdbc.JDBCCommon.sqlTypeToSmType(Unknown Source)
    at com.tibco.plugin.jdbc.JDBCCommon.sqlTypeToSmType(Unknown Source)
    at com.tibco.plugin.jdbc.JDBCGeneralActivity.evalGeneralStatement(Unknown Source)
    at com.tibco.plugin.jdbc.JDBCGeneralActivity.performDatabaseOperation(Unknown Source)
    at com.tibco.plugin.jdbc.JDBCActivity.eval(Unknown Source)
    at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    at com.tibco.pe.core.Job.a(Unknown Source)
    at com.tibco.pe.core.Job.k(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
    </StackTrace>
    <Msg>"JDBC error reported: (SQLState = ) - "This is not a valid SQL type: 2009""</Msg>
    <FullClass>com.tibco.plugin.jdbc.JDBCSQLException</FullClass>
    <Class>JDBCSQLException</Class>
    <ProcessStack>Processes/metrics_PROD.process/SQL Direct</ProcessStack>
    <MsgCode>BW-JDBC-100004</MsgCode>
    <Data>
        <ns1:JDBCSQLException xmlns:ns1 = "http://schemas.tibco.com/bw/plugins/jdbc/5.0/jdbcExceptions">
            <msg>"JDBC error reported: (SQLState = ) - "This is not a valid SQL type: 2009""</msg>
            <msgCode>BW-JDBC-100004</msgCode>
            <sqlState/>
            <detailStr>"This is not a valid SQL type: 2009"</detailStr>
        </ns1:JDBCSQLException>
    </Data>
</ns0:ErrorReport>

也不适用于 Tibco oracle 驱动程序。

    <StackTrace>Job-48000 Error in [Processes/Process Definition.process/JDBC Query]
"JDBC error reported: (SQLState = HY000) - java.sql.SQLException: [tibcosoftwareinc][Oracle JDBC Driver][Oracle]ORA-22275: invalid LOB locator specified
"
    at com.tibco.plugin.jdbc.JDBCActivity.eval(Unknown Source)
    at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    at com.tibco.pe.core.Job.a(Unknown Source)
    at com.tibco.pe.core.Job.k(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
caused by: java.sql.SQLException: [tibcosoftwareinc][Oracle JDBC Driver][Oracle]ORA-22275: invalid LOB locator specified

我使用中提供的解决方案解决了问题 I am trying to extract an XMLTYPE column from an Oracle table using JDBC and having some issues

将查询替换为

Select EXTRACT(XMLTYPE_column,'.').getClobVal()  from table

请注意,CLOB tibco 类型可用于使用 XMLType(?)

插入到 XML_TYPE 列

例子

insert into EXAMPLE_TABLE (ID, XMLTYPE_COLUMN)
values (?, XMLType(?))