Call an Oracle function from Java

后端 未结 4 626
鱼传尺愫
鱼传尺愫 2020-12-04 01:41

I am having issues calling an Oracle FUNCTION (not a Stored Procedure) from Java 1.6, using ojdbc14.jar.

I do not know what the function contains as I am calling it

4条回答
  •  渐次进展
    2020-12-04 02:04

    your return parameter is only one. the first one. that's the only one you must register its type. so, first thing first:

    cstmt.registerOutParameter(1, oracle.jdbc.OracleTypes.VARCHAR);

    then set/register the other parameters as needed, but you have 6 parameters as in question marks and you handle only 5. you'll need to set the 6th one as well:

    cstmt.setString(6, myVariable);

    if it is not clear, please post the prototype of sql function you are using and I'll point you to exact missing binding.

提交回复
热议问题