• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

ArrayDescriptor -- sql exception

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to pass object to stored procedure. I get the below error.

Can any one provide your feedback please?

Exception in thread "main" java.sql.SQLException: Fail to construct descriptor: Unable to resolve type: ".ACTIONPRIORITY"
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1776)
at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:251)
at com.inf.db.DAO613.insertService(DAO613.java:53)
at com.inf.ui.CM613.main(CM613.java:26)

code in the database:

create or replace TYPE ActionPriority AS OBJECT
(
Action_id NUMBER,
Priority NUMBER
);
/
create public synonym ACTIONPRIORITY for ActionPriority;

create or replace procedure testproc
(
ap ActionPriority
)
IS
BEGIN
dbms_output.put_line('test');
END;
/

I can see the description of object in database

SQL> desc ActionPriority
Name Null? Type
----------------------------------------- -------- ----------------------------
ACTION_ID NUMBER
PRIORITY NUMBER

SQL>

-------------

I am calling stored procedure from standard JAVA application.
database : oracle 10G

I have oracle 10G classes12.jar, ojdbc14.jar in class path.

JAVA code:

oracle.sql.ArrayDescriptor desc = new oracle.sql.ArrayDescriptor("ACTIONPRIORITY",con);
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic