inet datatype

Lists: pgsql-jdbc
From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: inet datatype
Date: 2003-12-04 02:12:36
Message-ID: 3FCE9814.9010200@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Is there any reason in particular that the inet type isn't returned by
the jdbc driver as an java.net.InetAddress ?


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Joseph Shraibman <jks(at)selectacast(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: inet datatype
Date: 2003-12-04 02:45:08
Message-ID: 20031204024508.GD5601@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Wed, Dec 03, 2003 at 09:12:36PM -0500, Joseph Shraibman wrote:
> Is there any reason in particular that the inet type isn't returned by
> the jdbc driver as an java.net.InetAddress ?

InetAddress doesn't store netmask information.

-O


From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: inet datatype
Date: 2003-12-04 03:14:50
Message-ID: 3FCEA6AA.90804@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Oliver Jowett wrote:
> On Wed, Dec 03, 2003 at 09:12:36PM -0500, Joseph Shraibman wrote:
>
>>Is there any reason in particular that the inet type isn't returned by
>>the jdbc driver as an java.net.InetAddress ?
>
>
> InetAddress doesn't store netmask information.
>
> -O
... and the alternative is... ? I say just return the InetAddress, and
if someone wants the netmask they'll have to call getString() and parse
it themselves. Doing nothing is not an option.


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Joseph Shraibman <jks(at)selectacast(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: inet datatype
Date: 2003-12-04 03:39:34
Message-ID: 20031204033934.GF5601@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Wed, Dec 03, 2003 at 10:14:50PM -0500, Joseph Shraibman wrote:
> Oliver Jowett wrote:
> >On Wed, Dec 03, 2003 at 09:12:36PM -0500, Joseph Shraibman wrote:
> >
> >>Is there any reason in particular that the inet type isn't returned by
> >>the jdbc driver as an java.net.InetAddress ?
> >
> >
> >InetAddress doesn't store netmask information.
> >
> >-O
> ... and the alternative is... ?

Build an appropriate class that stores the whole type, along the lines of
what's done for the geometric types. That class can implement a
toInetAddress() method if needed.

> I say just return the InetAddress, and
> if someone wants the netmask they'll have to call getString() and parse
> it themselves. Doing nothing is not an option.

I don't think doing a lossy conversion by default is a good solution.

-O