Object types and ResultSets (java.sql.Struct) - Mailing list pgsql-jdbc

From Thomas Kellerer
Subject Object types and ResultSets (java.sql.Struct)
Date
Msg-id hjf8o6$m49$1@ger.gmane.org
Whole thread Raw
Responses Re: Object types and ResultSets (java.sql.Struct)  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Hi,

I noticed that "object types" are not treated in a consistent manner

Taking the following table:

CREATE TYPE person_type AS
(
   first_name VARCHAR(20),
   last_name VARCHAR(25)
)

CREATE TABLE contacts
(
    id integer,
    contact person_type
)

DatabaseMetaData.getColumns() will return a java.sql.Types.STRUCT for the column "contact".
That seems to be correct to me - at least this is what I expected ;)

When running a "SELECT * FROM contacts", ResultSetMetaData.getColumnType() will return java.sql.Types.OTHER  (for the
contactcolumn) 

This seems to be inconsistent to me.

My expectation was that ResultSetMetaData.getColumnType() should also return java.sql.Types.STRUCT and that the object
returnedby getObject() on the ResultSet should implement java.sql.Struct (which it doesn't) 


Regards
Thomas

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: How to use JDBC to update LargeObject
Next
From: Juergen Weber
Date:
Subject: Add XATMI C API