1
值
我得到StudentIds的列表作爲List<String>
無法打印oracle.sql.ARRAY
我將其轉換成一個String[]
後來,
String[] studentIdArray = null;
if (list!= null) { // StudentList
studentIdArray = list.toArray(new String[list.size()]); // printed studentIdArray and print the values. its fine
}
然後,一個arrayDescriptor聲明映射Java的String[]
爲RAW的PLSQL表定義爲STUDENT_ID_TYPE
ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor("STUDENT_ID_TYPE", connection);
現在,我得到了oracle.sql.ARRAY
出來,
ARRAY studentArray = new ARRAY(arrayDescriptor, connection, studentIdArray);
我無法找到如何打印在studentArray值,雖然當我打印studentArray.length()
,它返回爲1,這 我覺得是正確的。 BUt當這個數組傳遞給我的PLSQL過程時,我得到自定義異常。
編輯:當我使用轉儲(),它只是轉儲爲元素[0] = [B @ 438620c7
認識到,將檢查並標記爲答案 – spiderman 2014-11-28 14:01:20
讓我們來看看它是如何工作:) – Willmore 2014-11-28 14:48:24
這就像一個魅力,太棒了!謝謝@MariusŽilėnas – spiderman 2014-12-09 19:47:37