| From: | Kris Jurka <books(at)ejurka(dot)com> | 
|---|---|
| To: | Marcin Gala <mailing(at)siec(dot)mine(dot)nu> | 
| Cc: | Postgres jdbc mailing list <pgsql-jdbc(at)postgresql(dot)org> | 
| Subject: | Re: JDBC and composite types | 
| Date: | 2007-05-21 15:35:11 | 
| Message-ID: | Pine.BSO.4.64.0705211122380.2299@leary.csoft.net | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-jdbc | 
On Sat, 19 May 2007, Marcin Gala wrote:
> Could anyone tell me, how to read table's columns that are of composite type? 
> I was trying to use getObject with different types of casting, however 
> nothing worked
Technically getObject on a complex type should return an instance of 
java.sql.Struct by default or an instance of java.sql.SQLData if the type 
has been mapped to a specific java class.  This has not been implemented 
in the pg driver yet though.
> :( Also getString doesn't give me a string representation of type...
>
It does for me. See the attached example.
Kris Jurka
| Attachment | Content-Type | Size | 
|---|---|---|
| CompositeType.java | text/plain | 766 bytes | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kris Jurka | 2007-05-21 16:27:48 | Re: Insert (or update) to a partitioned table returns 0 rows updated | 
| Previous Message | Marcin Gala | 2007-05-19 11:23:35 | JDBC and composite types |