简体   繁体   English

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

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

I am using Tibco BW 5.14 and Oracle 19c I have Oracle table that has XMLType column.我正在使用 Tibco BW 5.14 和 Oracle 19c 我有包含 XMLType 列的 Oracle 表。 I use native oracle jdbc driver 12.1.0.2.0 for database connection.我使用本机 oracle jdbc 驱动程序 12.1.0.2.0 进行数据库连接。

When I run query当我运行查询

Select XMLTYPE_column from table 

as SQL direct activity getting the error作为 SQL 直接活动得到错误

<?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>

also doesn't work with Tibco oracle driver.也不适用于 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 resolved the problem using solution provided in I am trying to extract an XMLTYPE column from an Oracle table using JDBC and having some issues我使用提供的解决方案解决了该问题我正在尝试使用 JDBC 从 Oracle 表中提取 XMLTYPE 列并遇到一些问题

replaced query to将查询替换为

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

在此处输入图片说明

Please note that CLOB tibco type can be used for inserting to XML_TYPE column using XMLType(?)请注意,CLOB tibco 类型可用于使用 XMLType(?)

example例子

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

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM