Re: Help:updateRow() with CIDR types

Поиск
Список
Период
Сортировка
От Moray Taylor
Тема Re: Help:updateRow() with CIDR types
Дата
Msg-id FA332F93-957D-11D8-A8BE-0003935AA5C0@the400.homeunix.com
обсуждение исходный текст
Ответ на Re: Help:updateRow() with CIDR types  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: Help:updateRow() with CIDR types
Re: Help:updateRow() with CIDR types
Список 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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: jdbc cts
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Help:updateRow() with CIDR types