Re: Help:updateRow() with CIDR types - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Help:updateRow() with CIDR types
Date
Msg-id Pine.BSO.4.56.0404232044570.6539@leary.csoft.net
Whole thread Raw
In response to Re: Help:updateRow() with CIDR types  (Moray Taylor <mugen@the400.homeunix.com>)
Responses Re: Help:updateRow() with CIDR types  (Moray Taylor <mugen@the400.homeunix.com>)
List pgsql-jdbc

On Sat, 24 Apr 2004, Moray Taylor wrote:

>
> On 23 Apr 2004, at 01:29, Oliver Jowett wrote:
>
> > Moray Taylor wrote:
> >> Hi,
> >> I'm having some trouble updating CIDR types using jdbc, I use
> >> updateObject() to change it, which goes OK, but when I do an
> >> updateRow(), I get this error
> >> java.sql.SQLException: ERROR: invalid cidr value: "1.1.1.1/4"
> >>     at
> >> org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateRow(AbstractJdbc2Res
> >> ul tSet.java:1117)
> >

Well this first error is backend error with detail of "Value has bits set
to right of mask."  Using a valid cidr value such as 192.168.1.0/24
produces the driver error I imagine you are complaining about.

> I was using updateObject(), I changed it to updateString, I still get
> an SQLException, with no getMessage() data, however, the data IS
> entered into the database, but the ResultSet isn't updated, i.e. I have
> to requery to see the results. Any ideas?
>

I have applied the attached patch to fix this to the cvs and stable
branches.  Binary versions are available here:
http://www.ejurka.com/pgsql/jars/

Kris Jurka

Attachment

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Help:updateRow() with CIDR types
Next
From: Moray Taylor
Date:
Subject: Re: Help:updateRow() with CIDR types