tags:

views:

54

answers:

1

Hi, I have such oracle object:

CREATE OR REPLACE type employee_obj
    AS
      object (
        id NUMBER(10) ,
        ...
      )

stored procedure

function get_employee_obj () return employee_obj is
      l_employee       employee_obj;
    begin
        ...
      return l_employee;
    end;

and I need to call it from java code:

    final String QUERY = "begin ? := GET_EMPLOYEE_OBJ(); end;";
    Connection connection = getConnection();

    CallableStatement stmt = connection.prepareCall(QUERY);
    stmt.registerOutParameter(1, <WHAT TO PUT HERE>);

    stmt.execute();
    ResultSet rs = (ResultSet) stmt.getObject(1);    
    ...

What sql or oracle type I need to specify as parameter for registerOutParameter to read object from stored function? I tried several, but allways got PLS-00382: expression is of wrong type error. Thanks!