Re: Help:updateRow() with CIDR types

From: Kris Jurka <books(at)ejurka(dot)com>
To: Moray Taylor <mugen(at)the400(dot)homeunix(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Help:updateRow() with CIDR types
Date: 2004-04-24 01:57:49
Message-ID: Pine.BSO.4.56.0404232044570.6539@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
updatecidr.patch text/plain 1.3 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Moray Taylor 2004-04-24 10:17:28 Re: Help:updateRow() with CIDR types
Previous Message Oliver Jowett 2004-04-23 23:59:18 Re: Help:updateRow() with CIDR types