From: | Moray Taylor <mugen(at)the400(dot)homeunix(dot)com> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: Help:updateRow() with CIDR types |
Date: | 2004-04-23 23:28:50 |
Message-ID: | FA332F93-957D-11D8-A8BE-0003935AA5C0@the400.homeunix.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
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)
>
> What object type and SQL typecode are you passing to updateObject()?
> Can we see that bit of code?
>
> Turn on log_statement on the backend; what is the entire query that
> errors?
>
> From memory the driver doesn't really have support for CIDR types
> other than as raw strings, but that might have changed..
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?
My code is pretty much this
String CIDR = "1.1.1.1/6";// just an example one
ResultSet RS = <code that gets resultset>
RS.absolute(<the row>);
RS.updateString("IP",CIDR);
RS.updateRow();// errors at this point, data is entered into the DB
though.
My code works perfectly for all the other types I've used, so it's
pretty much a CIDR thing I think.
Thanks for the reply.
Moray
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Jowett | 2004-04-23 23:59:18 | Re: Help:updateRow() with CIDR types |
Previous Message | Dave Cramer | 2004-04-23 17:29:40 | jdbc cts |