Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java

From: Muhammad Altaf <mmalik_altaf(at)yahoo(dot)com>
To: cognizant <sudipbajoria(at)gmail(dot)com>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
Date: 2012-04-06 11:14:01
Message-ID: 1333710841.58069.YahooMailNeo@web110406.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

UDTs are not yet supported in JDBC driver (using java.sql.Struct or SQLData)

 -- Altaf Malik

________________________________
From: cognizant <sudipbajoria(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Sent: Friday, 6 April 2012 12:58 AM
Subject: [JDBC] Issues with IN-OUT parameters for Array of Objects in EDB using Java

Hi

I am having issues with passing IN-OUT Parameters from a function which
returns a array of custom defined objects. I know that the new version(8.X+)
of EDB support nested tables and so was wondering this issue must be faced
by other java developers when trying to use the nested tables. Note I tried
types.Other, Array and STRUCT to register the output nested table object but
didnot work.

*Below is my SQL code*

create or replace
TYPE OT_Ref_Country AS OBJECT (
    countryId              Integer,
    isoFullName        Varchar2(256),
    doNotUseIndicator        Integer
);

create or replace
TYPE NT_Ref_Countries IS TABLE OF OT_Ref_Country;

FUNCTION getCountryList ( ip_countryId IN
Ref_Country.countryid%TYPE,iop_NT_Ref_Countries in out NT_Ref_Countries
) RETURN Number ;

*Java code:*

CallableStatement  st = con.prepareCall("{call
pkg_ref_geography_mgr.getCountryList(4,?)}");
st.registerOutParameter(1,Types.OTHER);
st.execute();

Please let me know if any additional details are needed. The version used is
Postgresql 8.4 with Java6

Tks for the help
-Mike

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Issues-with-IN-OUT-parameters-for-Array-of-Objects-in-EDB-using-Java-tp5620617p5620617.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message cognizant 2012-04-06 13:02:29 Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
Previous Message BCH 2012-04-06 08:05:54 JDBC DatabaseMetaData problem