Обсуждение: Integer fields

Поиск
Список
Период
Сортировка

Integer fields

От
"Waldomiro"
Дата:
Hi,
 
In my java application  when an user leave some integers field empty, it is saved without any digit like this --> ''
 
In postgres 7.2 it is working, but in 7.4 it doesn't
 
is there any set I should do on postgres 7.4?
 
Can someone help me?
 
Thanks

SHX INFORMÁTICA LTDA.
Waldomiro Caraiani
Desenvolvimento de Produto
+ 55 11 5581 1551
wmiro@shx.com.br
www.shx.com.br

Re: Integer fields

От
Roland Walter
Дата:
Waldomiro schrieb:

> Hi,
>
> In my java application  when an user leave some integers field empty,
> it is saved without any digit like this --> ''
>
> In postgres 7.2 it is working, but in 7.4 it doesn't
>
> is there any set I should do on postgres 7.4?
>

Use the method setNull(|int parameterIndex, int sqlType) from
java.sql.PreparedStatement if the field is empty.
sqlType should be java.sql.Types.INTEGER,
parmeterIndex the index in the PreparedStatement.

--
Roland Walter
MOSAIC SOFTWARE AG
email: rwa@mosaic-ag.com
|

Re: Integer fields

От
Kris Jurka
Дата:

On Thu, 23 Sep 2004, Waldomiro wrote:

> Hi,
>
> In my java application when an user leave some integers field empty, it
> is saved without any digit like this --> ''
>
> In postgres 7.2 it is working, but in 7.4 it doesn't

In 7.2 '' was treated as 0, but starting with the 7.3 release this is
recognized as an invalid integer value.  The bottom line is to fix your
code.

Kris Jurka