Marieke Vandamme <[EMAIL PROTECTED]> writes:
> Hello,
>
> We are trying to perform a select query to the Derby database with
> PreparedStatement
>
> PreparedStatement ps = c.prepareStatement("select * from table where value
> = ?");
> //several methods performed on statement (separately ofcourse)
> 1. ps.setNull(1,Types.VARCHAR);
> 2. ps.setObject(1, null, Types.VARCHAR);
> 3. ps.setString(1, null) ;
>
> The table contains null values, but the resultset is empty for the 3
> cases.
It doesn't return any rows because "value = null" does not evaluate to
true even when value in fact is null, in which case it evaluates to
unknown. "value is null" should work.
--
Knut Anders