Re: Postgres to Java type mapping

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'Paulo Merson'" <paulo(at)summa-tech(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Postgres to Java type mapping
Date: 2002-01-11 20:58:36
Message-ID: 011201c19ae2$bd2e7770$c201a8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Paulo,

TEXT maps to String
TIMESTAMP maps to Timestamp
SERIAL maps to Integer

The rest are not in the jdbc spec, and as a result do not map directly.
However since postgres returns strings for everything you can map them
to a String and then manipulate the underlying byte buffer.

Dave

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Paulo Merson
Sent: Friday, January 11, 2002 2:47 PM
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [JDBC] Postgres to Java type mapping

Hello,

I'd appreciate if anyone could indicate what is the recommended Java
type (or class) to map the following Postgres SQL types. I couldn't find
any document or previous message with such information.

SERIAL
TEXT
TIMESTAMP
BIT(n)
BIT VARYING(n)
INET
MACADDR
CIDR

Thank's,

Paulo Merson
Summa Technologies - www.summa-tech.com

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ivan Manuel Andrade Muñoz 2002-01-11 21:16:35 Error when executing example esql.xml in Cocoon1.8.2 uses postgresql
Previous Message Dave Cramer 2002-01-11 20:56:39 Re: compiling jdbc driver using java version 1.4.0 beta3 and postgresql 7.1.3