PostgreSQL data types mapped Java classes for JDBC

From: Thangalin <thangalin(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: PostgreSQL data types mapped Java classes for JDBC
Date: 2010-10-08 18:35:42
Message-ID: AANLkTikTEBsuqGZ4orEPFEgE4i+7a6GAF-w0TgQCFAdL@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

Where are the PostgreSQL data types mapped to Java classes? I have found the
following from an old mailing list message:

1 data_type_id Data Type Id java.lang.Integer int4 11
2 smallint_type Smallint Type java.lang.Integer int2 6
3 int_type Int Type java.lang.Integer int4 1130 macaddr_type Macaddr
Type java.lang.Object macaddr 2147483647
...
31 bit2_type Bit2 Type java.lang.Boolean bit 2
32 bitvarying5_type Bitvarying5 Type java.lang.Object varbit 5

Where is the most recent list?

Thank you!
Dave

P.S.
If these are not already in the information_schema (or similar), I think
they would make for a worthwhile addition.

Individual adaptions should not be stored external to PostgreSQL. It would
be trivial to set up a relation that:

1. Maintains a current list of PostgreSQL data types.
2. Maintains a list of adapters (perhaps with effective dating).
3. Maps adapters to Java types.

This would centralize the knowledge and facilitate dynamic implementations
that, for whatever reason, need to know the correct data type mapping in an
adapter-agnostic fashion. (Ideally adapters would map the PostgreSQL data
types to Java classes the same way; centralizing the list would reveal to
everyone the differences in the adapters without having to scour the web.)

This doesn't have to be packaged with PostgreSQL distributions: it could be
offered as a separate script that people can run to update the information
schema.

Browse pgsql-jdbc by date

  From Date Subject
Next Message John R Pierce 2010-10-08 18:37:24 Re: PostgreSQL data types mapped Java classes for JDBC
Previous Message Thangalin 2010-10-08 18:33:09 PostgreSQL data types mapped Java classes for JDBC