-2

I am using following in java code

StructDescriptor structDescriptor = StructDescriptor.createDescriptor("AF.TRANSACTIONDATATABLE", oracleConnection);

and following are my commands in db

CREATE OR REPLACE TYPE AF.TRANSACTIONDATATYPE AS OBJECT (
    no VARCHAR2(50),
    bh VARCHAR2(20),
    jb VARCHAR2(20),
    g VARCHAR2(20),
    hi VARCHAR2(30)
);

CREATE OR REPLACE TYPE AF.TRANSACTIONDATATABLE AS TABLE OF AFX_TLX_DS_USR.TRANSACTIONDATATYPE;

Still getting below

Caused by: java.sql.SQLException: Fail to construct descriptor: Invalid arguments
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:144)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:95)

unable to understand whats wrong

1
  • 1
    Did you post the entire stack trace? Commented Sep 4, 2024 at 4:47

1 Answer 1

1

AF.TRANSACTIONDATATABLE is a collection (Array) and not an object (Struct):

StructDescriptor structDescriptor = StructDescriptor.createDescriptor("AF.TRANSACTIONDATATYPE", oracleConnection);
ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor("AF.TRANSACTIONDATATABLE", oracleConnection);

You can see a complete code example in this answer

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.