wood burning stoves*
The moose likes JDBC and the fly likes Getting array of Oracle Objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Getting array of Oracle Objects" Watch "Getting array of Oracle Objects" New topic

Getting array of Oracle Objects

Prashanth menon
Ranch Hand

Joined: Feb 20, 2001
Posts: 65
I am using CallableStatements . The Oracle object I have is testobjtype and the package is testpkg. How do I register the outParameter of a varray type? I am getting error when I create a ArrayDescriptor ...

The code is below.

OracleCallableStatement callableStatement = (OracleCallableStatement)
con.prepareCall ("{ ? = call TESTPKG.testf(?)}");

callableStatement.setString(2, "test");

Object elements[] = new Object[20];

ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TYPE_VARRAY", con);
I tried with this also
ArrayDescriptor desc = ArrayDescriptor.createDescriptor("testobjtype", con);

ARRAY newArray = new ARRAY(desc, con, elements);
callableStatement.registerOutParameter(1, OracleTypes.ARRAY, "newArray");

ResultSet rs = (ResultSet)callableStatement.getObject (1);

SQLException java.sql.SQLException: invalid name pattern: TEST.TYPE_VARRAY
java.sql.SQLException: invalid name pattern: TEST.TYPE_VARRAY
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:424)
at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:343)
at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1002)
at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:132)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:97)
at com.busch.wms.interfaces.TestVarray.main(TestVarray.java:75)
I agree. Here's the link: http://aspose.com/file-tools
subject: Getting array of Oracle Objects
Similar Threads
java.sql.SQLException: invalid name pattern
trouble passing array to stored procedure in spring HELP
ArrayDescriptor Urgent
java.sql.SQLException: invalid name pattern: PFEP.file_import_nestedtable
Using java.sql.array