Yes,
ps.setNull(1, Types.TIMESTAMP) works.
But, once again, with the way my application works, when I bind the parameters, the query is already built. So, if my parameter is null, I have no way to guess its type.
I tried ps.setNull(1, Types.VARCHAR) as a fallback, and it works with a condition like "where ? is null". It does not work with a condition like "where birth_date > ?".
Maybe we could parse the query to use ps.setNull(1, Types.VARCHAR) when we have something like "? is null" (and a null bound parameter), but it seems to be weak (and a little bit dirty).
Why is the driver not able to ignore the parameter type when we just want to compare it to null?
Rémi.
So
ps.setNull(1, Types.TIMESTAMP);
Doesn't work ?
--