Connection connection = DriverManager.getConnection(DB_URL,userName,passWord);
ArrayDescriptor des = ArrayDescriptor.createDescriptor("ARRAY_TABLE", connection);
ARRAY array_to_pass = new ARRAY(des,connection,ssoIDs);
CallableStatement cs = connection.prepareCall("{ call TEST1 (?,?,?,?,?) }");
cs.setArray(1, array_to_pass);
// cs.registerOutParameter(2,sdate);
cs.setString(2, sdate);
cs.setString(3, edate);
//st.registerOutParameter(3,OracleTypes.ARRAY,"SchemaName.ARRAY_INT");
cs.registerOutParameter(4, OracleTypes.ARRAY, "ARRAY_TABLE");
cs.registerOutParameter(5, OracleTypes.ARRAY, "ARRAY_TABLE");
cs.execute(); // works fine .
然而
String[] aIdtobePassed = actorid.toArray(new String[actorid.size()]);
String[] pIdtobePassed=processid.toArray(new String[processid.size()]);
ArrayDescriptor desforActorId = ArrayDescriptor.createDescriptor("ARRAY_TABLE", connection);
ARRAY actorArray_to_pass = new ARRAY(desforActorId,connection,aIdtobePassed);
ArrayDescriptor desforProcessId = ArrayDescriptor.createDescriptor("ARRAY_TABLE", connection);
ARRAY processArray_to_pass = new ARRAY(desforProcessId,connection,pIdtobePassed);
CallableStatement csforST= connection.prepareCall("{ call TEST2 (?,?,?,?,?,?,?,?) }");
csforST.setArray(1, actorArray_to_pass);
// csforST.setString(1, "as");
csforST.setArray(2, processArray_to_pass);
csforST.registerOutParameter(3, OracleTypes.ARRAY, "ARRAY_TABLE");
csforST.registerOutParameter(4, OracleTypes.ARRAY, "ARRAY_TABLE");
csforST.registerOutParameter(5, OracleTypes.ARRAY, "ARRAY_TABLE");
csforST.registerOutParameter(6, OracleTypes.ARRAY, "ARRAY_TABLE");
csforST.registerOutParameter(7, OracleTypes.ARRAY, "ARRAY_TABLE");
csforST.registerOutParameter(8, OracleTypes.ARRAY, "ARRAY_TABLE");
csforST.execute(); // do not works
Test1 属于一个模式,Test2 属于另一个模式。
错误信息是
状态:65000 消息:ORA-06550:第 1 行,第 7 列:PLS-00201:必须声明标识符“TEST2” ORA-06550:第 1 行,第 7 列:PL/SQL:语句被忽略
我正在使用架构连接到数据库的 SQL 开发人员,因为我可以在架构上看到类似于它已连接的插头符号。但我不确定为什么它对任何人都不起作用,请帮忙?