calling oracle PL/SQL function in java - Invalid column type error

前端 未结 3 1212
天命终不由人
天命终不由人 2020-12-11 09:48

I want to call a plsql function from java class but that function (isValidPeriod) return a boolean datat type and JDBC doesn\'t support it

3条回答
  •  爱一瞬间的悲伤
    2020-12-11 10:16

    Due to a restriction in the OCI layer, the JDBC drivers do not support the passing of BOOLEAN parameters to PL/SQL stored procedures. The java boolean type does not match with the PL/SQl boolean type. The Oracle documentation indicates that BOOLEAN is a PL/SQL type only, and there is no mapping between the "java.lang.Boolean" class and the PL/SQL BOOLEAN data type.

    So I am afraid you may have to change your database PL/SQL function to return an integer instead

    or

    just create a wrapper: function isValidPeriodInt() return integer is begin end;

提交回复
热议问题