0

我正在调用一个将输入作为数字数组的存储过程。

从 Groovy 方面,我将 int[] 传递给该存储过程。

但是我得到“无效的列类型”作为存储过程的结果。

有人可以建议我如何从 Groovy 端传递一组数字吗?

我在存储过程方面创建的 TYPE 是;创建或替换 TYPE NUMBER_LIST IS TABLE OF NUMBER;

groovy 中的 int[] 是;int[] boxIntArr = new int[5];

我们可以通过 boxIntArr 代替 NUMBER_LIST 吗?

4

1 回答 1

1

You should be passing in an instance of java.sql.Array rather than a raw int[]. You can convert the Java array to a SQL array with java.sql.Connection.createArrayOf().

EDIT:

Oracle doesn't support the standard Connection.createArrayOf() method. Use the Oracle specific OracleConnection.createARRAY() method instead.

于 2013-04-01T21:00:02.943 回答