Subject | Re: [Firebird-Java] PreparedStatement, setInt() and NULL |
---|---|
Author | Yves Glodt |
Post date | 2008-08-05T21:34Z |
On Tuesday 05 August 2008, Roman Rokytskyy wrote:
INTEGER columns, to retrieve it's SQL-NULL value as java-null, and not
0?
Yves
> > How can I insert a NULL-value into an Integer column?Does this also work the other way round? e.g. use rst.getObject(1) on an
> >
> > pstmt.setInt(1, Null) fails since setInt expects a primitive "int",
> > which can not be null, but only 0 or 1.
> >
> > How do others get their NULLs into the database?
>
> Use either setObject(...) or setNull(...) method.
INTEGER columns, to retrieve it's SQL-NULL value as java-null, and not
0?
Yves
> Roman