由于在数据库的存储过程中用到了数组,所以在java调用时就会出现下列的代码
int[] intArray = { 5, 7, 9};
oracle.sql.ArrayDescriptor aDescriptor = new oracle.sql.ArrayDescriptor("SCOTT.TYPE1", connection);
oracle.sql.ARRAY array = new oracle.sql.ARRAY(aDescriptor, connection, intArray);
但是使用时会提示The type ArrayDescriptor is deprecated,所以使用下列方法代替
int[] intArray = { 5, 7, 9};
java.sql.Array array = connection.createOracleArray("SCOTT.TYPE1", intArray);