SpringJdbcTemplate:SQL state [null];错误代码[17004];执行带有返回值的函数作为JavaObject时,列类型1111无效

时间:2015-02-10 15:31:45

标签: java-7

我在项目中使用带有oracle 11g的Spring jdbcTemplate。我在使用返回值作为java类型执行函数时遇到了问题。请帮助我解决这个问题。

这里我添加了结构轮廓:

create or replace FUNCTION FUNC_DETAILS(
    P_FIRST         NUMBER DEFAULT 0,
    P_SECOND       VARCHAR2 DEFAULT 'N')
  RETURN JAVA_OBJ_TYPE
AS



create or replace TYPE JAVA_OBJ_TYPE
AS
  OBJECT
  (
    dash_board ANOTHER_JAVA_OBJ,
    card_dtls ANOTHER2_JAVA_OBJ,
    address_dtls ANOTHER3_JAVA_OBJ
  )

create or replace TYPE ANOTHER_JAVA_OBJ
AS
  OBJECT
  (
    FIRST_NUMBER         VARCHAR2(50),
    SECOND_NUMBER VARCHAR2(50),
  )

create or replace TYPE ANOTHER2_JAVA_OBJ
AS
  OBJECT
  (
    FIRST_NUMBER         VARCHAR2(50),
    SECOND_NUMBER VARCHAR2(50),
  )
create or replace TYPE ANOTHER3_JAVA_OBJ
AS
  OBJECT
  (
    FIRST_NUMBER         VARCHAR2(50),
    SECOND_NUMBER VARCHAR2(50),
  )



In java code:
SimpleJdbcCall simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate)
                    .withCatalogName(packageName) // package name
                    .withFunctionName(functionName);
                return simpleJdbcCall.executeFunction(JavaObj.class, in)

它抛出了这个错误:

SpringJdbcTemplate: SQL state [null]; error code [17004]; Invalid column type 1111 while executing function with return value as JavaObject

0 个答案:

没有答案